import 'package:domain/generated/json/base/json_convert_content.dart';
import 'package:domain/entity/response/contract_option_entity.dart';
import 'package:domain/entity/response/index_option_entity.dart';


ContractOptionEntity $ContractOptionEntityFromJson(Map<String, dynamic> json) {
  final ContractOptionEntity contractOptionEntity = ContractOptionEntity();
  final List<IndexOptionEntity>? agencyList = (json['agency_list'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<IndexOptionEntity>(e) as IndexOptionEntity).toList();
  if (agencyList != null) {
    contractOptionEntity.agencyList = agencyList;
  }
  final List<IndexOptionEntity>? statusList = (json['status_list'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<IndexOptionEntity>(e) as IndexOptionEntity).toList();
  if (statusList != null) {
    contractOptionEntity.statusList = statusList;
  }
  return contractOptionEntity;
}

Map<String, dynamic> $ContractOptionEntityToJson(ContractOptionEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['agency_list'] = entity.agencyList.map((v) => v.toJson()).toList();
  data['status_list'] = entity.statusList.map((v) => v.toJson()).toList();
  return data;
}

extension ContractOptionEntityExtension on ContractOptionEntity {
  ContractOptionEntity copyWith({
    List<IndexOptionEntity>? agencyList,
    List<IndexOptionEntity>? statusList,
  }) {
    return ContractOptionEntity()
      ..agencyList = agencyList ?? this.agencyList
      ..statusList = statusList ?? this.statusList;
  }
}