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

SGLabourRequestWorlFlowEntity $SGLabourRequestWorlFlowEntityFromJson(Map<String, dynamic> json) {
  final SGLabourRequestWorlFlowEntity sGLabourRequestWorlFlowEntity = SGLabourRequestWorlFlowEntity();
  final SGLabourRequestWorlFlowRow? row = jsonConvert.convert<SGLabourRequestWorlFlowRow>(json['row']);
  if (row != null) {
    sGLabourRequestWorlFlowEntity.row = row;
  }
  final String? outletId = jsonConvert.convert<String>(json['outlet_id']);
  if (outletId != null) {
    sGLabourRequestWorlFlowEntity.outletId = outletId;
  }
  final List<SGLabourRequestWorlFlowRecords>? records = (json['records'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<SGLabourRequestWorlFlowRecords>(e) as SGLabourRequestWorlFlowRecords).toList();
  if (records != null) {
    sGLabourRequestWorlFlowEntity.records = records;
  }
  return sGLabourRequestWorlFlowEntity;
}

Map<String, dynamic> $SGLabourRequestWorlFlowEntityToJson(SGLabourRequestWorlFlowEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['row'] = entity.row?.toJson();
  data['outlet_id'] = entity.outletId;
  data['records'] = entity.records.map((v) => v.toJson()).toList();
  return data;
}

extension SGLabourRequestWorlFlowEntityExtension on SGLabourRequestWorlFlowEntity {
  SGLabourRequestWorlFlowEntity copyWith({
    SGLabourRequestWorlFlowRow? row,
    String? outletId,
    List<SGLabourRequestWorlFlowRecords>? records,
  }) {
    return SGLabourRequestWorlFlowEntity()
      ..row = row ?? this.row
      ..outletId = outletId ?? this.outletId
      ..records = records ?? this.records;
  }
}

SGLabourRequestWorlFlowRow $SGLabourRequestWorlFlowRowFromJson(Map<String, dynamic> json) {
  final SGLabourRequestWorlFlowRow sGLabourRequestWorlFlowRow = SGLabourRequestWorlFlowRow();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    sGLabourRequestWorlFlowRow.id = id;
  }
  final String? employerId = jsonConvert.convert<String>(json['employer_id']);
  if (employerId != null) {
    sGLabourRequestWorlFlowRow.employerId = employerId;
  }
  final String? employerName = jsonConvert.convert<String>(json['employer_name']);
  if (employerName != null) {
    sGLabourRequestWorlFlowRow.employerName = employerName;
  }
  final String? eAdminId = jsonConvert.convert<String>(json['e_admin_id']);
  if (eAdminId != null) {
    sGLabourRequestWorlFlowRow.eAdminId = eAdminId;
  }
  final int? sourceType = jsonConvert.convert<int>(json['source_type']);
  if (sourceType != null) {
    sGLabourRequestWorlFlowRow.sourceType = sourceType;
  }
  final String? agencyId = jsonConvert.convert<String>(json['agency_id']);
  if (agencyId != null) {
    sGLabourRequestWorlFlowRow.agencyId = agencyId;
  }
  final String? agencyName = jsonConvert.convert<String>(json['agency_name']);
  if (agencyName != null) {
    sGLabourRequestWorlFlowRow.agencyName = agencyName;
  }
  final String? jobTitle = jsonConvert.convert<String>(json['job_title']);
  if (jobTitle != null) {
    sGLabourRequestWorlFlowRow.jobTitle = jobTitle;
  }
  final String? outletId = jsonConvert.convert<String>(json['outlet_id']);
  if (outletId != null) {
    sGLabourRequestWorlFlowRow.outletId = outletId;
  }
  final String? outletName = jsonConvert.convert<String>(json['outlet_name']);
  if (outletName != null) {
    sGLabourRequestWorlFlowRow.outletName = outletName;
  }
  final String? jobDate = jsonConvert.convert<String>(json['job_date']);
  if (jobDate != null) {
    sGLabourRequestWorlFlowRow.jobDate = jobDate;
  }
  final int? startTime = jsonConvert.convert<int>(json['start_time']);
  if (startTime != null) {
    sGLabourRequestWorlFlowRow.startTime = startTime;
  }
  final int? endTime = jsonConvert.convert<int>(json['end_time']);
  if (endTime != null) {
    sGLabourRequestWorlFlowRow.endTime = endTime;
  }
  final String? workingHours = jsonConvert.convert<String>(json['working_hours']);
  if (workingHours != null) {
    sGLabourRequestWorlFlowRow.workingHours = workingHours;
  }
  final String? hourlyRate = jsonConvert.convert<String>(json['hourly_rate']);
  if (hourlyRate != null) {
    sGLabourRequestWorlFlowRow.hourlyRate = hourlyRate;
  }
  final int? hiringNum = jsonConvert.convert<int>(json['hiring_num']);
  if (hiringNum != null) {
    sGLabourRequestWorlFlowRow.hiringNum = hiringNum;
  }
  final String? agencyRate = jsonConvert.convert<String>(json['agency_rate']);
  if (agencyRate != null) {
    sGLabourRequestWorlFlowRow.agencyRate = agencyRate;
  }
  final int? jobTitleId = jsonConvert.convert<int>(json['job_title_id']);
  if (jobTitleId != null) {
    sGLabourRequestWorlFlowRow.jobTitleId = jobTitleId;
  }
  final int? withFoodCert = jsonConvert.convert<int>(json['with_food_cert']);
  if (withFoodCert != null) {
    sGLabourRequestWorlFlowRow.withFoodCert = withFoodCert;
  }
  final int? requestType = jsonConvert.convert<int>(json['request_type']);
  if (requestType != null) {
    sGLabourRequestWorlFlowRow.requestType = requestType;
  }
  final int? sexLimit = jsonConvert.convert<int>(json['sex_limit']);
  if (sexLimit != null) {
    sGLabourRequestWorlFlowRow.sexLimit = sexLimit;
  }
  final int? maleLimit = jsonConvert.convert<int>(json['male_limit']);
  if (maleLimit != null) {
    sGLabourRequestWorlFlowRow.maleLimit = maleLimit;
  }
  final int? femaleLimit = jsonConvert.convert<int>(json['female_limit']);
  if (femaleLimit != null) {
    sGLabourRequestWorlFlowRow.femaleLimit = femaleLimit;
  }
  final int? positionId = jsonConvert.convert<int>(json['position_id']);
  if (positionId != null) {
    sGLabourRequestWorlFlowRow.positionId = positionId;
  }
  final String? positionName = jsonConvert.convert<String>(json['position_name']);
  if (positionName != null) {
    sGLabourRequestWorlFlowRow.positionName = positionName;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    sGLabourRequestWorlFlowRow.status = status;
  }
  final String? description = jsonConvert.convert<String>(json['description']);
  if (description != null) {
    sGLabourRequestWorlFlowRow.description = description;
  }
  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  if (createdAt != null) {
    sGLabourRequestWorlFlowRow.createdAt = createdAt;
  }
  final String? updatedAt = jsonConvert.convert<String>(json['updated_at']);
  if (updatedAt != null) {
    sGLabourRequestWorlFlowRow.updatedAt = updatedAt;
  }
  final String? deletedAt = jsonConvert.convert<String>(json['deleted_at']);
  if (deletedAt != null) {
    sGLabourRequestWorlFlowRow.deletedAt = deletedAt;
  }
  final int? postId = jsonConvert.convert<int>(json['post_id']);
  if (postId != null) {
    sGLabourRequestWorlFlowRow.postId = postId;
  }
  final String? postName = jsonConvert.convert<String>(json['post_name']);
  if (postName != null) {
    sGLabourRequestWorlFlowRow.postName = postName;
  }
  return sGLabourRequestWorlFlowRow;
}

Map<String, dynamic> $SGLabourRequestWorlFlowRowToJson(SGLabourRequestWorlFlowRow 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['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['agency_rate'] = entity.agencyRate;
  data['job_title_id'] = entity.jobTitleId;
  data['with_food_cert'] = entity.withFoodCert;
  data['request_type'] = entity.requestType;
  data['sex_limit'] = entity.sexLimit;
  data['male_limit'] = entity.maleLimit;
  data['female_limit'] = entity.femaleLimit;
  data['position_id'] = entity.positionId;
  data['position_name'] = entity.positionName;
  data['status'] = entity.status;
  data['description'] = entity.description;
  data['created_at'] = entity.createdAt;
  data['updated_at'] = entity.updatedAt;
  data['deleted_at'] = entity.deletedAt;
  data['post_id'] = entity.postId;
  data['post_name'] = entity.postName;
  return data;
}

extension SGLabourRequestWorlFlowRowExtension on SGLabourRequestWorlFlowRow {
  SGLabourRequestWorlFlowRow copyWith({
    String? id,
    String? employerId,
    String? employerName,
    String? eAdminId,
    int? sourceType,
    String? agencyId,
    String? agencyName,
    String? jobTitle,
    String? outletId,
    String? outletName,
    String? jobDate,
    int? startTime,
    int? endTime,
    String? workingHours,
    String? hourlyRate,
    int? hiringNum,
    String? agencyRate,
    int? jobTitleId,
    int? withFoodCert,
    int? requestType,
    int? sexLimit,
    int? maleLimit,
    int? femaleLimit,
    int? positionId,
    String? positionName,
    int? status,
    String? description,
    String? createdAt,
    String? updatedAt,
    String? deletedAt,
    int? postId,
    String? postName,
  }) {
    return SGLabourRequestWorlFlowRow()
      ..id = id ?? this.id
      ..employerId = employerId ?? this.employerId
      ..employerName = employerName ?? this.employerName
      ..eAdminId = eAdminId ?? this.eAdminId
      ..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
      ..agencyRate = agencyRate ?? this.agencyRate
      ..jobTitleId = jobTitleId ?? this.jobTitleId
      ..withFoodCert = withFoodCert ?? this.withFoodCert
      ..requestType = requestType ?? this.requestType
      ..sexLimit = sexLimit ?? this.sexLimit
      ..maleLimit = maleLimit ?? this.maleLimit
      ..femaleLimit = femaleLimit ?? this.femaleLimit
      ..positionId = positionId ?? this.positionId
      ..positionName = positionName ?? this.positionName
      ..status = status ?? this.status
      ..description = description ?? this.description
      ..createdAt = createdAt ?? this.createdAt
      ..updatedAt = updatedAt ?? this.updatedAt
      ..deletedAt = deletedAt ?? this.deletedAt
      ..postId = postId ?? this.postId
      ..postName = postName ?? this.postName;
  }
}

SGLabourRequestWorlFlowRecords $SGLabourRequestWorlFlowRecordsFromJson(Map<String, dynamic> json) {
  final SGLabourRequestWorlFlowRecords sGLabourRequestWorlFlowRecords = SGLabourRequestWorlFlowRecords();
  final int? serialNumber = jsonConvert.convert<int>(json['serial_number']);
  if (serialNumber != null) {
    sGLabourRequestWorlFlowRecords.serialNumber = serialNumber;
  }
  final String? nodeName = jsonConvert.convert<String>(json['node_name']);
  if (nodeName != null) {
    sGLabourRequestWorlFlowRecords.nodeName = nodeName;
  }
  final String? statusShow = jsonConvert.convert<String>(json['status_show']);
  if (statusShow != null) {
    sGLabourRequestWorlFlowRecords.statusShow = statusShow;
  }
  final String? auditName = jsonConvert.convert<String>(json['audit_name']);
  if (auditName != null) {
    sGLabourRequestWorlFlowRecords.auditName = auditName;
  }
  final String? auditTime = jsonConvert.convert<String>(json['audit_time']);
  if (auditTime != null) {
    sGLabourRequestWorlFlowRecords.auditTime = auditTime;
  }
  final String? auditMark = jsonConvert.convert<String>(json['audit_mark']);
  if (auditMark != null) {
    sGLabourRequestWorlFlowRecords.auditMark = auditMark;
  }
  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  if (createdAt != null) {
    sGLabourRequestWorlFlowRecords.createdAt = createdAt;
  }
  final String? assigneeTypeShow = jsonConvert.convert<String>(json['assignee_type_show']);
  if (assigneeTypeShow != null) {
    sGLabourRequestWorlFlowRecords.assigneeTypeShow = assigneeTypeShow;
  }
  final String? designationShow = jsonConvert.convert<String>(json['designation_show']);
  if (designationShow != null) {
    sGLabourRequestWorlFlowRecords.designationShow = designationShow;
  }
  return sGLabourRequestWorlFlowRecords;
}

Map<String, dynamic> $SGLabourRequestWorlFlowRecordsToJson(SGLabourRequestWorlFlowRecords entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['serial_number'] = entity.serialNumber;
  data['node_name'] = entity.nodeName;
  data['status_show'] = entity.statusShow;
  data['audit_name'] = entity.auditName;
  data['audit_time'] = entity.auditTime;
  data['audit_mark'] = entity.auditMark;
  data['created_at'] = entity.createdAt;
  data['assignee_type_show'] = entity.assigneeTypeShow;
  data['designation_show'] = entity.designationShow;
  return data;
}

extension SGLabourRequestWorlFlowRecordsExtension on SGLabourRequestWorlFlowRecords {
  SGLabourRequestWorlFlowRecords copyWith({
    int? serialNumber,
    String? nodeName,
    String? statusShow,
    String? auditName,
    String? auditTime,
    String? auditMark,
    String? createdAt,
    String? assigneeTypeShow,
    String? designationShow,
  }) {
    return SGLabourRequestWorlFlowRecords()
      ..serialNumber = serialNumber ?? this.serialNumber
      ..nodeName = nodeName ?? this.nodeName
      ..statusShow = statusShow ?? this.statusShow
      ..auditName = auditName ?? this.auditName
      ..auditTime = auditTime ?? this.auditTime
      ..auditMark = auditMark ?? this.auditMark
      ..createdAt = createdAt ?? this.createdAt
      ..assigneeTypeShow = assigneeTypeShow ?? this.assigneeTypeShow
      ..designationShow = designationShow ?? this.designationShow;
  }
}