// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'car.dart';

// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************

Car _$CarFromJson(Map<String, dynamic> json) => Car(
      id: json['id'] as String?,
      spz: json['spz'] as String,
      brand: json['brand'] as String,
      name: json['name'] as String,
      model: json['model'] as String,
      tyreType: $enumDecode(_$TyreTypeEnumMap, json['tyreType']),
      tollExpiration: json['tollExpiration'] == null
          ? null
          : DateTime.parse(json['tollExpiration'] as String),
      stkExpirations: (json['stkExpirations'] as List<dynamic>)
          .map((e) => DateTime.parse(e as String))
          .toList(),
      insurances: (json['insurances'] as List<dynamic>)
          .map((e) => Insurance.fromJson(e as Map<String, dynamic>))
          .toList(),
      serviceBook: (json['serviceBook'] as List<dynamic>)
          .map((e) => ServiceComment.fromJson(e as Map<String, dynamic>))
          .toList(),
    );

Map<String, dynamic> _$CarToJson(Car instance) => <String, dynamic>{
      'id': instance.id,
      'spz': instance.spz,
      'brand': instance.brand,
      'name': instance.name,
      'model': instance.model,
      'tyreType': _$TyreTypeEnumMap[instance.tyreType]!,
      'tollExpiration': instance.tollExpiration?.toIso8601String(),
      'stkExpirations':
          instance.stkExpirations.map((e) => e.toIso8601String()).toList(),
      'insurances': instance.insurances.map((e) => e.toJson()).toList(),
      'serviceBook': instance.serviceBook.map((e) => e.toJson()).toList(),
    };

const _$TyreTypeEnumMap = {
  TyreType.winter: 'winter',
  TyreType.summer: 'summer',
  TyreType.universal: 'universal',
};
