class CarLocationModel {
  int id;
  int driverId;
  double latitude;
  double longitude;
  DateTime createdAt;
  DateTime updatedAt;

  CarLocationModel({
    required this.id,
    required this.driverId,
    required this.latitude,
    required this.longitude,
    required this.createdAt,
    required this.updatedAt,
  });

  factory CarLocationModel.fromJson(Map<String, dynamic> json) {
    return CarLocationModel(
      id: json['id'],
      driverId: json['driver_id'],
      latitude: json['latitude'],
      longitude: json['longitude'],
      createdAt: DateTime.parse(json['created_at']),
      updatedAt: DateTime.parse(json['updated_at']),
    );
  }
}
