// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'equipment_history_dto.dart';

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

_$EquipmentHistoryDtoImpl _$$EquipmentHistoryDtoImplFromJson(
        Map<String, dynamic> json) =>
    _$EquipmentHistoryDtoImpl(
      id: (json['id'] as num?)?.toInt(),
      equipmentsId: (json['equipments_id'] as num).toInt(),
      warehousesId: (json['warehouses_id'] as num).toInt(),
      transactionType: json['transaction_type'] as String,
      quantity: (json['quantity'] as num).toInt(),
      transactedAt: DateTime.parse(json['transacted_at'] as String),
      remark: json['remark'] as String?,
      isDeleted: json['is_deleted'] as bool? ?? false,
      createdAt: DateTime.parse(json['created_at'] as String),
      updatedAt: json['updated_at'] == null
          ? null
          : DateTime.parse(json['updated_at'] as String),
      equipmentSerial: json['equipment_serial'] as String?,
      warehouseName: json['warehouse_name'] as String?,
      companies: (json['companies'] as List<dynamic>?)
              ?.map((e) => e as Map<String, dynamic>)
              .toList() ??
          const [],
      equipment: json['equipment'] == null
          ? null
          : EquipmentDto.fromJson(json['equipment'] as Map<String, dynamic>),
      warehouse: json['warehouse'] == null
          ? null
          : WarehouseDto.fromJson(json['warehouse'] as Map<String, dynamic>),
    );

Map<String, dynamic> _$$EquipmentHistoryDtoImplToJson(
        _$EquipmentHistoryDtoImpl instance) =>
    <String, dynamic>{
      'id': instance.id,
      'equipments_id': instance.equipmentsId,
      'warehouses_id': instance.warehousesId,
      'transaction_type': instance.transactionType,
      'quantity': instance.quantity,
      'transacted_at': instance.transactedAt.toIso8601String(),
      'remark': instance.remark,
      'is_deleted': instance.isDeleted,
      'created_at': instance.createdAt.toIso8601String(),
      'updated_at': instance.updatedAt?.toIso8601String(),
      'equipment_serial': instance.equipmentSerial,
      'warehouse_name': instance.warehouseName,
      'companies': instance.companies,
      'equipment': instance.equipment,
      'warehouse': instance.warehouse,
    };

_$EquipmentHistoryRequestDtoImpl _$$EquipmentHistoryRequestDtoImplFromJson(
        Map<String, dynamic> json) =>
    _$EquipmentHistoryRequestDtoImpl(
      equipmentsId: (json['equipments_id'] as num).toInt(),
      warehousesId: (json['warehouses_id'] as num?)?.toInt(),
      companyIds: (json['company_ids'] as List<dynamic>?)
          ?.map((e) => (e as num).toInt())
          .toList(),
      transactionType: json['transaction_type'] as String,
      quantity: (json['quantity'] as num).toInt(),
      transactedAt: json['transacted_at'] == null
          ? null
          : DateTime.parse(json['transacted_at'] as String),
      remark: json['remark'] as String?,
    );

Map<String, dynamic> _$$EquipmentHistoryRequestDtoImplToJson(
        _$EquipmentHistoryRequestDtoImpl instance) =>
    <String, dynamic>{
      'equipments_id': instance.equipmentsId,
      'warehouses_id': instance.warehousesId,
      'company_ids': instance.companyIds,
      'transaction_type': instance.transactionType,
      'quantity': instance.quantity,
      'transacted_at': instance.transactedAt?.toIso8601String(),
      'remark': instance.remark,
    };

_$EquipmentHistoryUpdateRequestDtoImpl
    _$$EquipmentHistoryUpdateRequestDtoImplFromJson(
            Map<String, dynamic> json) =>
        _$EquipmentHistoryUpdateRequestDtoImpl(
          warehousesId: (json['warehouses_id'] as num?)?.toInt(),
          transactionType: json['transaction_type'] as String?,
          quantity: (json['quantity'] as num?)?.toInt(),
          transactedAt: json['transacted_at'] == null
              ? null
              : DateTime.parse(json['transacted_at'] as String),
          remark: json['remark'] as String?,
        );

Map<String, dynamic> _$$EquipmentHistoryUpdateRequestDtoImplToJson(
        _$EquipmentHistoryUpdateRequestDtoImpl instance) =>
    <String, dynamic>{
      'warehouses_id': instance.warehousesId,
      'transaction_type': instance.transactionType,
      'quantity': instance.quantity,
      'transacted_at': instance.transactedAt?.toIso8601String(),
      'remark': instance.remark,
    };

_$EquipmentHistoryListResponseImpl _$$EquipmentHistoryListResponseImplFromJson(
        Map<String, dynamic> json) =>
    _$EquipmentHistoryListResponseImpl(
      items: (json['data'] as List<dynamic>)
          .map((e) => EquipmentHistoryDto.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> _$$EquipmentHistoryListResponseImplToJson(
        _$EquipmentHistoryListResponseImpl instance) =>
    <String, dynamic>{
      'data': instance.items,
      'total': instance.totalCount,
      'page': instance.currentPage,
      'total_pages': instance.totalPages,
      'page_size': instance.pageSize,
    };
