// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'equipment_dto.dart';

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

_$EquipmentDtoImpl _$$EquipmentDtoImplFromJson(Map<String, dynamic> json) =>
    _$EquipmentDtoImpl(
      id: (json['id'] as num).toInt(),
      companiesId: (json['companies_id'] as num).toInt(),
      companyName: json['company_name'] as String?,
      modelsId: (json['models_id'] as num).toInt(),
      modelName: json['model_name'] as String?,
      vendorName: json['vendor_name'] as String?,
      warehousesId: (json['warehouses_id'] as num?)?.toInt(),
      warehousesName: json['warehouses_name'] as String?,
      serialNumber: json['serial_number'] as String,
      barcode: json['barcode'] as String?,
      purchasedAt: json['purchased_at'] == null
          ? null
          : DateTime.parse(json['purchased_at'] as String),
      purchasePrice: (json['purchase_price'] as num?)?.toInt() ?? 0,
      warrantyNumber: json['warranty_number'] as String,
      warrantyStartedAt: DateTime.parse(json['warranty_started_at'] as String),
      warrantyEndedAt: DateTime.parse(json['warranty_ended_at'] as String),
      remark: json['remark'] as String?,
      isDeleted: json['is_deleted'] as bool? ?? false,
      registeredAt: json['registered_at'] == null
          ? null
          : DateTime.parse(json['registered_at'] as String),
      updatedAt: json['updated_at'] == null
          ? null
          : DateTime.parse(json['updated_at'] as String),
    );

Map<String, dynamic> _$$EquipmentDtoImplToJson(_$EquipmentDtoImpl instance) =>
    <String, dynamic>{
      'id': instance.id,
      'companies_id': instance.companiesId,
      'models_id': instance.modelsId,
      'warehouses_id': instance.warehousesId,
      'serial_number': instance.serialNumber,
      'barcode': instance.barcode,
      'purchased_at': instance.purchasedAt?.toIso8601String(),
      'purchase_price': instance.purchasePrice,
      'warranty_number': instance.warrantyNumber,
      'warranty_started_at': instance.warrantyStartedAt.toIso8601String(),
      'warranty_ended_at': instance.warrantyEndedAt.toIso8601String(),
      'remark': instance.remark,
      'is_deleted': instance.isDeleted,
      'registered_at': instance.registeredAt?.toIso8601String(),
      'updated_at': instance.updatedAt?.toIso8601String(),
    };

_$EquipmentRequestDtoImpl _$$EquipmentRequestDtoImplFromJson(
        Map<String, dynamic> json) =>
    _$EquipmentRequestDtoImpl(
      companiesId: (json['companies_id'] as num?)?.toInt(),
      modelsId: (json['models_id'] as num?)?.toInt(),
      serialNumber: json['serial_number'] as String,
      barcode: json['barcode'] as String?,
      purchasedAt: DateTime.parse(json['purchased_at'] as String),
      purchasePrice: (json['purchase_price'] as num?)?.toInt() ?? 0,
      warrantyNumber: json['warranty_number'] as String,
      warrantyStartedAt: DateTime.parse(json['warranty_started_at'] as String),
      warrantyEndedAt: DateTime.parse(json['warranty_ended_at'] as String),
      remark: json['remark'] as String?,
    );

Map<String, dynamic> _$$EquipmentRequestDtoImplToJson(
        _$EquipmentRequestDtoImpl instance) =>
    <String, dynamic>{
      'companies_id': instance.companiesId,
      'models_id': instance.modelsId,
      'serial_number': instance.serialNumber,
      'barcode': instance.barcode,
      'purchased_at': instance.purchasedAt.toIso8601String(),
      'purchase_price': instance.purchasePrice,
      'warranty_number': instance.warrantyNumber,
      'warranty_started_at': instance.warrantyStartedAt.toIso8601String(),
      'warranty_ended_at': instance.warrantyEndedAt.toIso8601String(),
      'remark': instance.remark,
    };

_$EquipmentUpdateRequestDtoImpl _$$EquipmentUpdateRequestDtoImplFromJson(
        Map<String, dynamic> json) =>
    _$EquipmentUpdateRequestDtoImpl(
      companiesId: (json['companies_id'] as num?)?.toInt(),
      modelsId: (json['models_id'] as num?)?.toInt(),
      serialNumber: json['serial_number'] as String?,
      barcode: json['barcode'] as String?,
      purchasedAt: json['purchased_at'] == null
          ? null
          : DateTime.parse(json['purchased_at'] as String),
      purchasePrice: (json['purchase_price'] as num?)?.toInt(),
      warrantyNumber: json['warranty_number'] as String?,
      warrantyStartedAt: json['warranty_started_at'] == null
          ? null
          : DateTime.parse(json['warranty_started_at'] as String),
      warrantyEndedAt: json['warranty_ended_at'] == null
          ? null
          : DateTime.parse(json['warranty_ended_at'] as String),
      remark: json['remark'] as String?,
    );

Map<String, dynamic> _$$EquipmentUpdateRequestDtoImplToJson(
        _$EquipmentUpdateRequestDtoImpl instance) =>
    <String, dynamic>{
      'companies_id': instance.companiesId,
      'models_id': instance.modelsId,
      'serial_number': instance.serialNumber,
      'barcode': instance.barcode,
      'purchased_at': instance.purchasedAt?.toIso8601String(),
      'purchase_price': instance.purchasePrice,
      'warranty_number': instance.warrantyNumber,
      'warranty_started_at': instance.warrantyStartedAt?.toIso8601String(),
      'warranty_ended_at': instance.warrantyEndedAt?.toIso8601String(),
      'remark': instance.remark,
    };

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