// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'maintenance_dto.dart';

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

_$MaintenanceDtoImpl _$$MaintenanceDtoImplFromJson(Map<String, dynamic> json) =>
    _$MaintenanceDtoImpl(
      id: (json['id'] as num?)?.toInt(),
      equipmentHistoryId: (json['equipment_history_id'] as num?)?.toInt(),
      startedAt: DateTime.parse(json['started_at'] as String),
      endedAt: DateTime.parse(json['ended_at'] as String),
      periodMonth: (json['period_month'] as num?)?.toInt() ?? 1,
      maintenanceType: json['maintenance_type'] as String? ?? 'V',
      isDeleted: json['is_deleted'] as bool? ?? false,
      registeredAt: DateTime.parse(json['registered_at'] as String),
      updatedAt: json['updated_at'] == null
          ? null
          : DateTime.parse(json['updated_at'] as String),
      equipmentSerial: json['equipment_serial'] as String?,
      equipmentModel: json['equipment_model'] as String?,
      companyId: (json['company_id'] as num?)?.toInt(),
      companyName: json['company_name'] as String?,
      daysRemaining: (json['days_remaining'] as num?)?.toInt(),
      isExpired: json['is_expired'] as bool? ?? false,
      equipmentHistory: json['equipmentHistory'] == null
          ? null
          : EquipmentHistoryDto.fromJson(
              json['equipmentHistory'] as Map<String, dynamic>),
    );

Map<String, dynamic> _$$MaintenanceDtoImplToJson(
        _$MaintenanceDtoImpl instance) =>
    <String, dynamic>{
      'id': instance.id,
      'equipment_history_id': instance.equipmentHistoryId,
      'started_at': instance.startedAt.toIso8601String(),
      'ended_at': instance.endedAt.toIso8601String(),
      'period_month': instance.periodMonth,
      'maintenance_type': instance.maintenanceType,
      'is_deleted': instance.isDeleted,
      'registered_at': instance.registeredAt.toIso8601String(),
      'updated_at': instance.updatedAt?.toIso8601String(),
      'equipment_serial': instance.equipmentSerial,
      'equipment_model': instance.equipmentModel,
      'company_id': instance.companyId,
      'company_name': instance.companyName,
      'days_remaining': instance.daysRemaining,
      'is_expired': instance.isExpired,
      'equipmentHistory': instance.equipmentHistory,
    };

_$MaintenanceRequestDtoImpl _$$MaintenanceRequestDtoImplFromJson(
        Map<String, dynamic> json) =>
    _$MaintenanceRequestDtoImpl(
      equipmentHistoryId: (json['equipment_history_id'] as num?)?.toInt(),
      startedAt: DateTime.parse(json['started_at'] as String),
      endedAt: DateTime.parse(json['ended_at'] as String),
      periodMonth: (json['period_month'] as num?)?.toInt() ?? 1,
      maintenanceType: json['maintenance_type'] as String? ?? 'V',
    );

Map<String, dynamic> _$$MaintenanceRequestDtoImplToJson(
        _$MaintenanceRequestDtoImpl instance) =>
    <String, dynamic>{
      'equipment_history_id': instance.equipmentHistoryId,
      'started_at': instance.startedAt.toIso8601String(),
      'ended_at': instance.endedAt.toIso8601String(),
      'period_month': instance.periodMonth,
      'maintenance_type': instance.maintenanceType,
    };

_$MaintenanceUpdateRequestDtoImpl _$$MaintenanceUpdateRequestDtoImplFromJson(
        Map<String, dynamic> json) =>
    _$MaintenanceUpdateRequestDtoImpl(
      startedAt: json['started_at'] == null
          ? null
          : DateTime.parse(json['started_at'] as String),
      endedAt: json['ended_at'] == null
          ? null
          : DateTime.parse(json['ended_at'] as String),
      periodMonth: (json['period_month'] as num?)?.toInt(),
      maintenanceType: json['maintenance_type'] as String?,
    );

Map<String, dynamic> _$$MaintenanceUpdateRequestDtoImplToJson(
        _$MaintenanceUpdateRequestDtoImpl instance) =>
    <String, dynamic>{
      'started_at': instance.startedAt?.toIso8601String(),
      'ended_at': instance.endedAt?.toIso8601String(),
      'period_month': instance.periodMonth,
      'maintenance_type': instance.maintenanceType,
    };

_$MaintenanceListResponseImpl _$$MaintenanceListResponseImplFromJson(
        Map<String, dynamic> json) =>
    _$MaintenanceListResponseImpl(
      items: (json['data'] as List<dynamic>)
          .map((e) => MaintenanceDto.fromJson(e as Map<String, dynamic>))
          .toList(),
      totalCount: (json['total'] as num).toInt(),
      currentPage: (json['page'] as num).toInt(),
      totalPages: (json['total_pages'] as num).toInt(),
      pageSize: (json['page_size'] as num?)?.toInt(),
    );

Map<String, dynamic> _$$MaintenanceListResponseImplToJson(
        _$MaintenanceListResponseImpl instance) =>
    <String, dynamic>{
      'data': instance.items,
      'total': instance.totalCount,
      'page': instance.currentPage,
      'total_pages': instance.totalPages,
      'page_size': instance.pageSize,
    };

_$MaintenanceQueryDtoImpl _$$MaintenanceQueryDtoImplFromJson(
        Map<String, dynamic> json) =>
    _$MaintenanceQueryDtoImpl(
      equipmentId: (json['equipment_id'] as num?)?.toInt(),
      maintenanceType: json['maintenance_type'] as String?,
      isExpired: json['is_expired'] as bool?,
      expiringDays: (json['expiring_days'] as num?)?.toInt(),
      page: (json['page'] as num?)?.toInt() ?? 1,
      perPage: (json['per_page'] as num?)?.toInt() ?? 10,
      includeDeleted: json['include_deleted'] as bool? ?? false,
    );

Map<String, dynamic> _$$MaintenanceQueryDtoImplToJson(
        _$MaintenanceQueryDtoImpl instance) =>
    <String, dynamic>{
      'equipment_id': instance.equipmentId,
      'maintenance_type': instance.maintenanceType,
      'is_expired': instance.isExpired,
      'expiring_days': instance.expiringDays,
      'page': instance.page,
      'per_page': instance.perPage,
      'include_deleted': instance.includeDeleted,
    };
