import 'package:json_annotation/json_annotation.dart';

part 'car.g.dart';

@JsonSerializable(fieldRename: FieldRename.snake)
class Car {
  final int id;
  final String carName;
  final String? driverName;

  Car({
    required this.id,
    required this.carName,
    this.driverName,
  });

  factory Car.fromJson(Map<String, dynamic> json) => _$CarFromJson(json);
  Map<String, dynamic> toJson() => _$CarToJson(this);
}
