// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'company_dto.dart';

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

_$CompanyDtoImpl _$$CompanyDtoImplFromJson(Map<String, dynamic> json) =>
    _$CompanyDtoImpl(
      id: (json['id'] as num?)?.toInt(),
      name: json['name'] as String,
      contactName: json['contact_name'] as String,
      contactPhone: json['contact_phone'] as String,
      contactEmail: json['contact_email'] as String,
      parentCompanyId: (json['parent_company_id'] as num?)?.toInt(),
      zipcodesZipcode: json['zipcodes_zipcode'] as String?,
      address: json['address'] as String,
      remark: json['remark'] as String?,
      isPartner: json['is_partner'] as bool? ?? false,
      isCustomer: json['is_customer'] as bool? ?? false,
      isActive: json['is_active'] as bool? ?? false,
      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),
      parentCompany: json['parent_company'] == null
          ? null
          : CompanyNameDto.fromJson(
              json['parent_company'] as Map<String, dynamic>),
      zipcode: json['zipcode'] == null
          ? null
          : ZipcodeDto.fromJson(json['zipcode'] as Map<String, dynamic>),
    );

Map<String, dynamic> _$$CompanyDtoImplToJson(_$CompanyDtoImpl instance) =>
    <String, dynamic>{
      'id': instance.id,
      'name': instance.name,
      'contact_name': instance.contactName,
      'contact_phone': instance.contactPhone,
      'contact_email': instance.contactEmail,
      'parent_company_id': instance.parentCompanyId,
      'zipcodes_zipcode': instance.zipcodesZipcode,
      'address': instance.address,
      'remark': instance.remark,
      'is_partner': instance.isPartner,
      'is_customer': instance.isCustomer,
      'is_active': instance.isActive,
      'is_deleted': instance.isDeleted,
      'registered_at': instance.registeredAt?.toIso8601String(),
      'updated_at': instance.updatedAt?.toIso8601String(),
      'parent_company': instance.parentCompany,
      'zipcode': instance.zipcode,
    };

_$CompanyNameDtoImpl _$$CompanyNameDtoImplFromJson(Map<String, dynamic> json) =>
    _$CompanyNameDtoImpl(
      id: (json['id'] as num).toInt(),
      name: json['name'] as String,
    );

Map<String, dynamic> _$$CompanyNameDtoImplToJson(
        _$CompanyNameDtoImpl instance) =>
    <String, dynamic>{
      'id': instance.id,
      'name': instance.name,
    };

_$CompanyRequestDtoImpl _$$CompanyRequestDtoImplFromJson(
        Map<String, dynamic> json) =>
    _$CompanyRequestDtoImpl(
      name: json['name'] as String,
      contactName: json['contact_name'] as String,
      contactPhone: json['contact_phone'] as String,
      contactEmail: json['contact_email'] as String,
      parentCompanyId: (json['parent_company_id'] as num?)?.toInt(),
      zipcodesZipcode: json['zipcodes_zipcode'] as String?,
      address: json['address'] as String,
      remark: json['remark'] as String?,
      isPartner: json['is_partner'] as bool? ?? false,
      isCustomer: json['is_customer'] as bool? ?? false,
      isActive: json['is_active'] as bool? ?? false,
    );

Map<String, dynamic> _$$CompanyRequestDtoImplToJson(
        _$CompanyRequestDtoImpl instance) =>
    <String, dynamic>{
      'name': instance.name,
      'contact_name': instance.contactName,
      'contact_phone': instance.contactPhone,
      'contact_email': instance.contactEmail,
      'parent_company_id': instance.parentCompanyId,
      'zipcodes_zipcode': instance.zipcodesZipcode,
      'address': instance.address,
      'remark': instance.remark,
      'is_partner': instance.isPartner,
      'is_customer': instance.isCustomer,
      'is_active': instance.isActive,
    };

_$CompanyUpdateRequestDtoImpl _$$CompanyUpdateRequestDtoImplFromJson(
        Map<String, dynamic> json) =>
    _$CompanyUpdateRequestDtoImpl(
      name: json['name'] as String?,
      contactName: json['contact_name'] as String?,
      contactPhone: json['contact_phone'] as String?,
      contactEmail: json['contact_email'] as String?,
      parentCompanyId: (json['parent_company_id'] as num?)?.toInt(),
      zipcodesZipcode: json['zipcodes_zipcode'] as String?,
      address: json['address'] as String?,
      remark: json['remark'] as String?,
      isPartner: json['is_partner'] as bool?,
      isCustomer: json['is_customer'] as bool?,
      isActive: json['is_active'] as bool?,
    );

Map<String, dynamic> _$$CompanyUpdateRequestDtoImplToJson(
        _$CompanyUpdateRequestDtoImpl instance) =>
    <String, dynamic>{
      'name': instance.name,
      'contact_name': instance.contactName,
      'contact_phone': instance.contactPhone,
      'contact_email': instance.contactEmail,
      'parent_company_id': instance.parentCompanyId,
      'zipcodes_zipcode': instance.zipcodesZipcode,
      'address': instance.address,
      'remark': instance.remark,
      'is_partner': instance.isPartner,
      'is_customer': instance.isCustomer,
      'is_active': instance.isActive,
    };

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