// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'company_list_dto.dart';

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

_$CompanyListDtoImpl _$$CompanyListDtoImplFromJson(Map<String, dynamic> json) =>
    _$CompanyListDtoImpl(
      id: (json['id'] as num).toInt(),
      name: json['name'] as String,
      address: json['address'] as String?,
      contactName: json['contact_name'] 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(),
      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(),
      registeredAt: json['registered_at'] == null
          ? null
          : DateTime.parse(json['registered_at'] as String),
      childCount: (json['child_count'] as num?)?.toInt() ?? 0,
    );

Map<String, dynamic> _$$CompanyListDtoImplToJson(
        _$CompanyListDtoImpl instance) =>
    <String, dynamic>{
      'id': instance.id,
      'name': instance.name,
      'address': instance.address,
      'contact_name': instance.contactName,
      'contact_phone': instance.contactPhone,
      'contact_email': instance.contactEmail,
      'company_types': instance.companyTypes,
      'is_active': instance.isActive,
      'is_partner': instance.isPartner,
      'is_customer': instance.isCustomer,
      'parent_company_id': instance.parentCompanyId,
      'registered_at': instance.registeredAt?.toIso8601String(),
      'child_count': instance.childCount,
    };

_$CompanyWithChildrenImpl _$$CompanyWithChildrenImplFromJson(
        Map<String, dynamic> json) =>
    _$CompanyWithChildrenImpl(
      company: CompanyDto.fromJson(json['company'] as Map<String, dynamic>),
      children: (json['children'] as List<dynamic>?)
              ?.map((e) => CompanyDto.fromJson(e as Map<String, dynamic>))
              .toList() ??
          const [],
    );

Map<String, dynamic> _$$CompanyWithChildrenImplToJson(
        _$CompanyWithChildrenImpl instance) =>
    <String, dynamic>{
      'company': instance.company,
      'children': instance.children,
    };
