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


LabourRequestEROptionEntity $LabourRequestEROptionEntityFromJson(Map<String, dynamic> json) {
  final LabourRequestEROptionEntity labourRequestEROptionEntity = LabourRequestEROptionEntity();
  final List<IndexOptionEntity>? titleList = (json['title_list'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<IndexOptionEntity>(e) as IndexOptionEntity).toList();
  if (titleList != null) {
    labourRequestEROptionEntity.titleList = titleList;
  }
  final List<IndexOptionEntity>? outletList = (json['outlet_list'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<IndexOptionEntity>(e) as IndexOptionEntity).toList();
  if (outletList != null) {
    labourRequestEROptionEntity.outletList = outletList;
  }
  final List<IndexOptionEntity>? limitList = (json['limit_list'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<IndexOptionEntity>(e) as IndexOptionEntity).toList();
  if (limitList != null) {
    labourRequestEROptionEntity.limitList = limitList;
  }
  final List<IndexOptionEntity>? otRadios = (json['ot_radios'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<IndexOptionEntity>(e) as IndexOptionEntity).toList();
  if (otRadios != null) {
    labourRequestEROptionEntity.otRadios = otRadios;
  }
  final bool? outletManager = jsonConvert.convert<bool>(json['outlet_manager']);
  if (outletManager != null) {
    labourRequestEROptionEntity.outletManager = outletManager;
  }
  final String? hiringNum = jsonConvert.convert<String>(json['hiring_num']);
  if (hiringNum != null) {
    labourRequestEROptionEntity.hiringNum = hiringNum;
  }
  final int? sexLimit = jsonConvert.convert<int>(json['sex_limit']);
  if (sexLimit != null) {
    labourRequestEROptionEntity.sexLimit = sexLimit;
  }
  final String? maleLimit = jsonConvert.convert<String>(json['male_limit']);
  if (maleLimit != null) {
    labourRequestEROptionEntity.maleLimit = maleLimit;
  }
  final String? femaleLimit = jsonConvert.convert<String>(json['female_limit']);
  if (femaleLimit != null) {
    labourRequestEROptionEntity.femaleLimit = femaleLimit;
  }
  final bool? withOtJob = jsonConvert.convert<bool>(json['with_ot_job']);
  if (withOtJob != null) {
    labourRequestEROptionEntity.withOtJob = withOtJob;
  }
  final String? view = jsonConvert.convert<String>(json['view']);
  if (view != null) {
    labourRequestEROptionEntity.view = view;
  }
  return labourRequestEROptionEntity;
}

Map<String, dynamic> $LabourRequestEROptionEntityToJson(LabourRequestEROptionEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['title_list'] = entity.titleList.map((v) => v.toJson()).toList();
  data['outlet_list'] = entity.outletList.map((v) => v.toJson()).toList();
  data['limit_list'] = entity.limitList.map((v) => v.toJson()).toList();
  data['ot_radios'] = entity.otRadios.map((v) => v.toJson()).toList();
  data['outlet_manager'] = entity.outletManager;
  data['hiring_num'] = entity.hiringNum;
  data['sex_limit'] = entity.sexLimit;
  data['male_limit'] = entity.maleLimit;
  data['female_limit'] = entity.femaleLimit;
  data['with_ot_job'] = entity.withOtJob;
  data['view'] = entity.view;
  return data;
}

extension LabourRequestEROptionEntityExtension on LabourRequestEROptionEntity {
  LabourRequestEROptionEntity copyWith({
    List<IndexOptionEntity>? titleList,
    List<IndexOptionEntity>? outletList,
    List<IndexOptionEntity>? limitList,
    List<IndexOptionEntity>? otRadios,
    bool? outletManager,
    String? hiringNum,
    int? sexLimit,
    String? maleLimit,
    String? femaleLimit,
    bool? withOtJob,
    String? view,
  }) {
    return LabourRequestEROptionEntity()
      ..titleList = titleList ?? this.titleList
      ..outletList = outletList ?? this.outletList
      ..limitList = limitList ?? this.limitList
      ..otRadios = otRadios ?? this.otRadios
      ..outletManager = outletManager ?? this.outletManager
      ..hiringNum = hiringNum ?? this.hiringNum
      ..sexLimit = sexLimit ?? this.sexLimit
      ..maleLimit = maleLimit ?? this.maleLimit
      ..femaleLimit = femaleLimit ?? this.femaleLimit
      ..withOtJob = withOtJob ?? this.withOtJob
      ..view = view ?? this.view;
  }
}