// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'company_dto.dart';

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

_$CreateCompanyRequestImpl _$$CreateCompanyRequestImplFromJson(
        Map<String, dynamic> json) =>
    _$CreateCompanyRequestImpl(
      name: json['name'] as String,
      address: json['address'] as String,
      contactName: json['contact_name'] as String,
      contactPosition: json['contact_position'] as String,
      contactPhone: json['contact_phone'] as String,
      contactEmail: json['contact_email'] as String,
      companyTypes: (json['company_types'] as List<dynamic>?)
              ?.map((e) => e as String)
              .toList() ??
          const [],
      isPartner: json['is_partner'] as bool? ?? false,
      isCustomer: json['is_customer'] as bool? ?? true,
      parentCompanyId: (json['parent_company_id'] as num?)?.toInt(),
      remark: json['remark'] as String?,
    );

Map<String, dynamic> _$$CreateCompanyRequestImplToJson(
        _$CreateCompanyRequestImpl instance) =>
    <String, dynamic>{
      'name': instance.name,
      'address': instance.address,
      'contact_name': instance.contactName,
      'contact_position': instance.contactPosition,
      'contact_phone': instance.contactPhone,
      'contact_email': instance.contactEmail,
      'company_types': instance.companyTypes,
      'is_partner': instance.isPartner,
      'is_customer': instance.isCustomer,
      'parent_company_id': instance.parentCompanyId,
      'remark': instance.remark,
    };

_$UpdateCompanyRequestImpl _$$UpdateCompanyRequestImplFromJson(
        Map<String, dynamic> json) =>
    _$UpdateCompanyRequestImpl(
      name: json['name'] as String?,
      address: json['address'] as String?,
      contactName: json['contact_name'] as String?,
      contactPosition: json['contact_position'] as String?,
      contactPhone: json['contact_phone'] as String?,
      contactEmail: json['contact_email'] as String?,
      companyTypes: (json['company_types'] as List<dynamic>?)
          ?.map((e) => e as String)
          .toList(),
      isPartner: json['is_partner'] as bool?,
      isCustomer: json['is_customer'] as bool?,
      parentCompanyId: (json['parent_company_id'] as num?)?.toInt(),
      remark: json['remark'] as String?,
      isActive: json['is_active'] as bool?,
    );

Map<String, dynamic> _$$UpdateCompanyRequestImplToJson(
        _$UpdateCompanyRequestImpl instance) =>
    <String, dynamic>{
      'name': instance.name,
      'address': instance.address,
      'contact_name': instance.contactName,
      'contact_position': instance.contactPosition,
      'contact_phone': instance.contactPhone,
      'contact_email': instance.contactEmail,
      'company_types': instance.companyTypes,
      'is_partner': instance.isPartner,
      'is_customer': instance.isCustomer,
      'parent_company_id': instance.parentCompanyId,
      'remark': instance.remark,
      'is_active': instance.isActive,
    };

_$CompanyResponseImpl _$$CompanyResponseImplFromJson(
        Map<String, dynamic> json) =>
    _$CompanyResponseImpl(
      id: (json['id'] as num).toInt(),
      name: json['name'] as String,
      address: json['address'] as String?,
      contactName: json['contact_name'] as String,
      contactPosition: json['contact_position'] as String?,
      contactPhone: json['contact_phone'] as String,
      contactEmail: json['contact_email'] as String,
      companyTypes: (json['company_types'] as List<dynamic>?)
              ?.map((e) => e as String)
              .toList() ??
          const [],
      remark: json['remark'] as String?,
      isActive: json['is_active'] as bool,
      isPartner: json['is_partner'] as bool? ?? false,
      isCustomer: json['is_customer'] as bool? ?? false,
      parentCompanyId: (json['parent_company_id'] as num?)?.toInt(),
      createdAt: DateTime.parse(json['created_at'] as String),
      updatedAt: json['updated_at'] == null
          ? null
          : DateTime.parse(json['updated_at'] as String),
      addressId: (json['address_id'] as num?)?.toInt(),
    );

Map<String, dynamic> _$$CompanyResponseImplToJson(
        _$CompanyResponseImpl instance) =>
    <String, dynamic>{
      'id': instance.id,
      'name': instance.name,
      'address': instance.address,
      'contact_name': instance.contactName,
      'contact_position': instance.contactPosition,
      'contact_phone': instance.contactPhone,
      'contact_email': instance.contactEmail,
      'company_types': instance.companyTypes,
      'remark': instance.remark,
      'is_active': instance.isActive,
      'is_partner': instance.isPartner,
      'is_customer': instance.isCustomer,
      'parent_company_id': instance.parentCompanyId,
      'created_at': instance.createdAt.toIso8601String(),
      'updated_at': instance.updatedAt?.toIso8601String(),
      'address_id': instance.addressId,
    };

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