// 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? ?? 'O',
      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),
      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(),
      '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? ?? 'O',
    );

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,
    };
