import 'car.dart';
import 'package:json_annotation/json_annotation.dart';

part 'driver.g.dart';

@JsonSerializable(fieldRename: FieldRename.snake)
class DriverDTO {
  DriverDTO({required this.id, required this.name, required this.salutation, required this.cars});
  String id;
  String name;
  String salutation;
  List<CarDTO> cars;

  factory DriverDTO.fromJson(Map<String, dynamic> json) => _$DriverDTOFromJson(json);
  Map<dynamic, dynamic> toJson() => _$DriverDTOToJson(this);
}