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


JobListERDetailEntity $JobListERDetailEntityFromJson(Map<String, dynamic> json) {
  final JobListERDetailEntity jobListERDetailEntity = JobListERDetailEntity();
  final JobListERDetailJob? job = jsonConvert.convert<JobListERDetailJob>(json['job']);
  if (job != null) {
    jobListERDetailEntity.job = job;
  }
  final String? startTime = jsonConvert.convert<String>(json['start_time']);
  if (startTime != null) {
    jobListERDetailEntity.startTime = startTime;
  }
  final String? endTime = jsonConvert.convert<String>(json['end_time']);
  if (endTime != null) {
    jobListERDetailEntity.endTime = endTime;
  }
  final List<IndexOptionEntity>? titleList = (json['title_list'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<IndexOptionEntity>(e) as IndexOptionEntity).toList();
  if (titleList != null) {
    jobListERDetailEntity.titleList = titleList;
  }
  final List<IndexOptionEntity>? limitList = (json['limit_list'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<IndexOptionEntity>(e) as IndexOptionEntity).toList();
  if (limitList != null) {
    jobListERDetailEntity.limitList = limitList;
  }
  final List<IndexOptionEntity>? outletList = (json['outlet_list'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<IndexOptionEntity>(e) as IndexOptionEntity).toList();
  if (outletList != null) {
    jobListERDetailEntity.outletList = outletList;
  }
  final String? view = jsonConvert.convert<String>(json['view']);
  if (view != null) {
    jobListERDetailEntity.view = view;
  }
  return jobListERDetailEntity;
}

Map<String, dynamic> $JobListERDetailEntityToJson(JobListERDetailEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['job'] = entity.job?.toJson();
  data['start_time'] = entity.startTime;
  data['end_time'] = entity.endTime;
  data['title_list'] = entity.titleList.map((v) => v.toJson()).toList();
  data['limit_list'] = entity.limitList.map((v) => v.toJson()).toList();
  data['outlet_list'] = entity.outletList.map((v) => v.toJson()).toList();
  data['view'] = entity.view;
  return data;
}

extension JobListERDetailEntityExtension on JobListERDetailEntity {
  JobListERDetailEntity copyWith({
    JobListERDetailJob? job,
    String? startTime,
    String? endTime,
    List<IndexOptionEntity>? titleList,
    List<IndexOptionEntity>? limitList,
    List<IndexOptionEntity>? outletList,
    String? view,
  }) {
    return JobListERDetailEntity()
      ..job = job ?? this.job
      ..startTime = startTime ?? this.startTime
      ..endTime = endTime ?? this.endTime
      ..titleList = titleList ?? this.titleList
      ..limitList = limitList ?? this.limitList
      ..outletList = outletList ?? this.outletList
      ..view = view ?? this.view;
  }
}

JobListERDetailJob $JobListERDetailJobFromJson(Map<String, dynamic> json) {
  final JobListERDetailJob jobListERDetailJob = JobListERDetailJob();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    jobListERDetailJob.id = id;
  }
  final String? employerId = jsonConvert.convert<String>(json['employer_id']);
  if (employerId != null) {
    jobListERDetailJob.employerId = employerId;
  }
  final String? employerName = jsonConvert.convert<String>(json['employer_name']);
  if (employerName != null) {
    jobListERDetailJob.employerName = employerName;
  }
  final String? eAdminId = jsonConvert.convert<String>(json['e_admin_id']);
  if (eAdminId != null) {
    jobListERDetailJob.eAdminId = eAdminId;
  }
  final String? yyJobId = jsonConvert.convert<String>(json['yy_job_id']);
  if (yyJobId != null) {
    jobListERDetailJob.yyJobId = yyJobId;
  }
  final int? sourceType = jsonConvert.convert<int>(json['source_type']);
  if (sourceType != null) {
    jobListERDetailJob.sourceType = sourceType;
  }
  final String? agencyId = jsonConvert.convert<String>(json['agency_id']);
  if (agencyId != null) {
    jobListERDetailJob.agencyId = agencyId;
  }
  final String? agencyName = jsonConvert.convert<String>(json['agency_name']);
  if (agencyName != null) {
    jobListERDetailJob.agencyName = agencyName;
  }
  final String? jobTitle = jsonConvert.convert<String>(json['job_title']);
  if (jobTitle != null) {
    jobListERDetailJob.jobTitle = jobTitle;
  }
  final String? outletId = jsonConvert.convert<String>(json['outlet_id']);
  if (outletId != null) {
    jobListERDetailJob.outletId = outletId;
  }
  final String? outletName = jsonConvert.convert<String>(json['outlet_name']);
  if (outletName != null) {
    jobListERDetailJob.outletName = outletName;
  }
  final String? jobDate = jsonConvert.convert<String>(json['job_date']);
  if (jobDate != null) {
    jobListERDetailJob.jobDate = jobDate;
  }
  final String? startTime = jsonConvert.convert<String>(json['start_time']);
  if (startTime != null) {
    jobListERDetailJob.startTime = startTime;
  }
  final String? endTime = jsonConvert.convert<String>(json['end_time']);
  if (endTime != null) {
    jobListERDetailJob.endTime = endTime;
  }
  final String? workingHours = jsonConvert.convert<String>(json['working_hours']);
  if (workingHours != null) {
    jobListERDetailJob.workingHours = workingHours;
  }
  final String? hourlyRate = jsonConvert.convert<String>(json['hourly_rate']);
  if (hourlyRate != null) {
    jobListERDetailJob.hourlyRate = hourlyRate;
  }
  final String? hiringNum = jsonConvert.convert<String>(json['hiring_num']);
  if (hiringNum != null) {
    jobListERDetailJob.hiringNum = hiringNum;
  }
  final String? realNum = jsonConvert.convert<String>(json['real_num']);
  if (realNum != null) {
    jobListERDetailJob.realNum = realNum;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    jobListERDetailJob.status = status;
  }
  final String? description = jsonConvert.convert<String>(json['description']);
  if (description != null) {
    jobListERDetailJob.description = description;
  }
  final int? confirmStatus = jsonConvert.convert<int>(json['confirm_status']);
  if (confirmStatus != null) {
    jobListERDetailJob.confirmStatus = confirmStatus;
  }
  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  if (createdAt != null) {
    jobListERDetailJob.createdAt = createdAt;
  }
  final String? updatedAt = jsonConvert.convert<String>(json['updated_at']);
  if (updatedAt != null) {
    jobListERDetailJob.updatedAt = updatedAt;
  }
  final String? deletedAt = jsonConvert.convert<String>(json['deleted_at']);
  if (deletedAt != null) {
    jobListERDetailJob.deletedAt = deletedAt;
  }
  final String? eventName = jsonConvert.convert<String>(json['event_name']);
  if (eventName != null) {
    jobListERDetailJob.eventName = eventName;
  }
  final String? eventType = jsonConvert.convert<String>(json['event_type']);
  if (eventType != null) {
    jobListERDetailJob.eventType = eventType;
  }
  final int? withTyphoid = jsonConvert.convert<int>(json['with_typhoid']);
  if (withTyphoid != null) {
    jobListERDetailJob.withTyphoid = withTyphoid;
  }
  final int? syncPayroll = jsonConvert.convert<int>(json['sync_payroll']);
  if (syncPayroll != null) {
    jobListERDetailJob.syncPayroll = syncPayroll;
  }
  final String? agencyRate = jsonConvert.convert<String>(json['agency_rate']);
  if (agencyRate != null) {
    jobListERDetailJob.agencyRate = agencyRate;
  }
  final String? requestId = jsonConvert.convert<String>(json['request_id']);
  if (requestId != null) {
    jobListERDetailJob.requestId = requestId;
  }
  final String? jobTitleId = jsonConvert.convert<String>(json['job_title_id']);
  if (jobTitleId != null) {
    jobListERDetailJob.jobTitleId = jobTitleId;
  }
  final int? isOt = jsonConvert.convert<int>(json['is_ot']);
  if (isOt != null) {
    jobListERDetailJob.isOt = isOt;
  }
  final String? positionId = jsonConvert.convert<String>(json['position_id']);
  if (positionId != null) {
    jobListERDetailJob.positionId = positionId;
  }
  final String? sexLimit = jsonConvert.convert<String>(json['sex_limit']);
  if (sexLimit != null) {
    jobListERDetailJob.sexLimit = sexLimit;
  }
  final String? maleLimit = jsonConvert.convert<String>(json['male_limit']);
  if (maleLimit != null) {
    jobListERDetailJob.maleLimit = maleLimit;
  }
  final String? femaleLimit = jsonConvert.convert<String>(json['female_limit']);
  if (femaleLimit != null) {
    jobListERDetailJob.femaleLimit = femaleLimit;
  }
  return jobListERDetailJob;
}

Map<String, dynamic> $JobListERDetailJobToJson(JobListERDetailJob entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['employer_id'] = entity.employerId;
  data['employer_name'] = entity.employerName;
  data['e_admin_id'] = entity.eAdminId;
  data['yy_job_id'] = entity.yyJobId;
  data['source_type'] = entity.sourceType;
  data['agency_id'] = entity.agencyId;
  data['agency_name'] = entity.agencyName;
  data['job_title'] = entity.jobTitle;
  data['outlet_id'] = entity.outletId;
  data['outlet_name'] = entity.outletName;
  data['job_date'] = entity.jobDate;
  data['start_time'] = entity.startTime;
  data['end_time'] = entity.endTime;
  data['working_hours'] = entity.workingHours;
  data['hourly_rate'] = entity.hourlyRate;
  data['hiring_num'] = entity.hiringNum;
  data['real_num'] = entity.realNum;
  data['status'] = entity.status;
  data['description'] = entity.description;
  data['confirm_status'] = entity.confirmStatus;
  data['created_at'] = entity.createdAt;
  data['updated_at'] = entity.updatedAt;
  data['deleted_at'] = entity.deletedAt;
  data['event_name'] = entity.eventName;
  data['event_type'] = entity.eventType;
  data['with_typhoid'] = entity.withTyphoid;
  data['sync_payroll'] = entity.syncPayroll;
  data['agency_rate'] = entity.agencyRate;
  data['request_id'] = entity.requestId;
  data['job_title_id'] = entity.jobTitleId;
  data['is_ot'] = entity.isOt;
  data['position_id'] = entity.positionId;
  data['sex_limit'] = entity.sexLimit;
  data['male_limit'] = entity.maleLimit;
  data['female_limit'] = entity.femaleLimit;
  return data;
}

extension JobListERDetailJobExtension on JobListERDetailJob {
  JobListERDetailJob copyWith({
    String? id,
    String? employerId,
    String? employerName,
    String? eAdminId,
    String? yyJobId,
    int? sourceType,
    String? agencyId,
    String? agencyName,
    String? jobTitle,
    String? outletId,
    String? outletName,
    String? jobDate,
    String? startTime,
    String? endTime,
    String? workingHours,
    String? hourlyRate,
    String? hiringNum,
    String? realNum,
    int? status,
    String? description,
    int? confirmStatus,
    String? createdAt,
    String? updatedAt,
    String? deletedAt,
    String? eventName,
    String? eventType,
    int? withTyphoid,
    int? syncPayroll,
    String? agencyRate,
    String? requestId,
    String? jobTitleId,
    int? isOt,
    String? positionId,
    String? sexLimit,
    String? maleLimit,
    String? femaleLimit,
  }) {
    return JobListERDetailJob()
      ..id = id ?? this.id
      ..employerId = employerId ?? this.employerId
      ..employerName = employerName ?? this.employerName
      ..eAdminId = eAdminId ?? this.eAdminId
      ..yyJobId = yyJobId ?? this.yyJobId
      ..sourceType = sourceType ?? this.sourceType
      ..agencyId = agencyId ?? this.agencyId
      ..agencyName = agencyName ?? this.agencyName
      ..jobTitle = jobTitle ?? this.jobTitle
      ..outletId = outletId ?? this.outletId
      ..outletName = outletName ?? this.outletName
      ..jobDate = jobDate ?? this.jobDate
      ..startTime = startTime ?? this.startTime
      ..endTime = endTime ?? this.endTime
      ..workingHours = workingHours ?? this.workingHours
      ..hourlyRate = hourlyRate ?? this.hourlyRate
      ..hiringNum = hiringNum ?? this.hiringNum
      ..realNum = realNum ?? this.realNum
      ..status = status ?? this.status
      ..description = description ?? this.description
      ..confirmStatus = confirmStatus ?? this.confirmStatus
      ..createdAt = createdAt ?? this.createdAt
      ..updatedAt = updatedAt ?? this.updatedAt
      ..deletedAt = deletedAt ?? this.deletedAt
      ..eventName = eventName ?? this.eventName
      ..eventType = eventType ?? this.eventType
      ..withTyphoid = withTyphoid ?? this.withTyphoid
      ..syncPayroll = syncPayroll ?? this.syncPayroll
      ..agencyRate = agencyRate ?? this.agencyRate
      ..requestId = requestId ?? this.requestId
      ..jobTitleId = jobTitleId ?? this.jobTitleId
      ..isOt = isOt ?? this.isOt
      ..positionId = positionId ?? this.positionId
      ..sexLimit = sexLimit ?? this.sexLimit
      ..maleLimit = maleLimit ?? this.maleLimit
      ..femaleLimit = femaleLimit ?? this.femaleLimit;
  }
}