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

SGAttendanceReviewWorkflowEntity $SGAttendanceReviewWorkflowEntityFromJson(Map<String, dynamic> json) {
  final SGAttendanceReviewWorkflowEntity sGAttendanceReviewWorkflowEntity = SGAttendanceReviewWorkflowEntity();
  final SGAttendanceReviewWorkflowRow? row = jsonConvert.convert<SGAttendanceReviewWorkflowRow>(json['row']);
  if (row != null) {
    sGAttendanceReviewWorkflowEntity.row = row;
  }
  final String? outletId = jsonConvert.convert<String>(json['outlet_id']);
  if (outletId != null) {
    sGAttendanceReviewWorkflowEntity.outletId = outletId;
  }
  final List<SGAttendanceReviewWorkflowRecords>? records = (json['records'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<SGAttendanceReviewWorkflowRecords>(e) as SGAttendanceReviewWorkflowRecords).toList();
  if (records != null) {
    sGAttendanceReviewWorkflowEntity.records = records;
  }
  return sGAttendanceReviewWorkflowEntity;
}

Map<String, dynamic> $SGAttendanceReviewWorkflowEntityToJson(SGAttendanceReviewWorkflowEntity 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 SGAttendanceReviewWorkflowEntityExtension on SGAttendanceReviewWorkflowEntity {
  SGAttendanceReviewWorkflowEntity copyWith({
    SGAttendanceReviewWorkflowRow? row,
    String? outletId,
    List<SGAttendanceReviewWorkflowRecords>? records,
  }) {
    return SGAttendanceReviewWorkflowEntity()
      ..row = row ?? this.row
      ..outletId = outletId ?? this.outletId
      ..records = records ?? this.records;
  }
}

SGAttendanceReviewWorkflowRow $SGAttendanceReviewWorkflowRowFromJson(Map<String, dynamic> json) {
  final SGAttendanceReviewWorkflowRow sGAttendanceReviewWorkflowRow = SGAttendanceReviewWorkflowRow();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    sGAttendanceReviewWorkflowRow.id = id;
  }
  final String? jobId = jsonConvert.convert<String>(json['job_id']);
  if (jobId != null) {
    sGAttendanceReviewWorkflowRow.jobId = jobId;
  }
  final String? sId = jsonConvert.convert<String>(json['s_id']);
  if (sId != null) {
    sGAttendanceReviewWorkflowRow.sId = sId;
  }
  final String? memberId = jsonConvert.convert<String>(json['member_id']);
  if (memberId != null) {
    sGAttendanceReviewWorkflowRow.memberId = memberId;
  }
  final String? labourerId = jsonConvert.convert<String>(json['labourer_id']);
  if (labourerId != null) {
    sGAttendanceReviewWorkflowRow.labourerId = labourerId;
  }
  final String? labourerName = jsonConvert.convert<String>(json['labourer_name']);
  if (labourerName != null) {
    sGAttendanceReviewWorkflowRow.labourerName = labourerName;
  }
  final String? labourerNric = jsonConvert.convert<String>(json['labourer_nric']);
  if (labourerNric != null) {
    sGAttendanceReviewWorkflowRow.labourerNric = labourerNric;
  }
  final int? sourceType = jsonConvert.convert<int>(json['source_type']);
  if (sourceType != null) {
    sGAttendanceReviewWorkflowRow.sourceType = sourceType;
  }
  final int? employerId = jsonConvert.convert<int>(json['employer_id']);
  if (employerId != null) {
    sGAttendanceReviewWorkflowRow.employerId = employerId;
  }
  final String? employerName = jsonConvert.convert<String>(json['employer_name']);
  if (employerName != null) {
    sGAttendanceReviewWorkflowRow.employerName = employerName;
  }
  final int? agencyId = jsonConvert.convert<int>(json['agency_id']);
  if (agencyId != null) {
    sGAttendanceReviewWorkflowRow.agencyId = agencyId;
  }
  final String? agencyName = jsonConvert.convert<String>(json['agency_name']);
  if (agencyName != null) {
    sGAttendanceReviewWorkflowRow.agencyName = agencyName;
  }
  final String? jobTitle = jsonConvert.convert<String>(json['job_title']);
  if (jobTitle != null) {
    sGAttendanceReviewWorkflowRow.jobTitle = jobTitle;
  }
  final String? outletId = jsonConvert.convert<String>(json['outlet_id']);
  if (outletId != null) {
    sGAttendanceReviewWorkflowRow.outletId = outletId;
  }
  final String? outletName = jsonConvert.convert<String>(json['outlet_name']);
  if (outletName != null) {
    sGAttendanceReviewWorkflowRow.outletName = outletName;
  }
  final String? ballroomId = jsonConvert.convert<String>(json['ballroom_id']);
  if (ballroomId != null) {
    sGAttendanceReviewWorkflowRow.ballroomId = ballroomId;
  }
  final String? ballroomName = jsonConvert.convert<String>(json['ballroom_name']);
  if (ballroomName != null) {
    sGAttendanceReviewWorkflowRow.ballroomName = ballroomName;
  }
  final String? jobDate = jsonConvert.convert<String>(json['job_date']);
  if (jobDate != null) {
    sGAttendanceReviewWorkflowRow.jobDate = jobDate;
  }
  final int? startTime = jsonConvert.convert<int>(json['start_time']);
  if (startTime != null) {
    sGAttendanceReviewWorkflowRow.startTime = startTime;
  }
  final int? endTime = jsonConvert.convert<int>(json['end_time']);
  if (endTime != null) {
    sGAttendanceReviewWorkflowRow.endTime = endTime;
  }
  final String? workingHours = jsonConvert.convert<String>(json['working_hours']);
  if (workingHours != null) {
    sGAttendanceReviewWorkflowRow.workingHours = workingHours;
  }
  final String? adjustHours = jsonConvert.convert<String>(json['adjust_hours']);
  if (adjustHours != null) {
    sGAttendanceReviewWorkflowRow.adjustHours = adjustHours;
  }
  final String? totalHours = jsonConvert.convert<String>(json['total_hours']);
  if (totalHours != null) {
    sGAttendanceReviewWorkflowRow.totalHours = totalHours;
  }
  final String? hourlyRate = jsonConvert.convert<String>(json['hourly_rate']);
  if (hourlyRate != null) {
    sGAttendanceReviewWorkflowRow.hourlyRate = hourlyRate;
  }
  final String? grossWage = jsonConvert.convert<String>(json['gross_wage']);
  if (grossWage != null) {
    sGAttendanceReviewWorkflowRow.grossWage = grossWage;
  }
  final int? securityClockIn = jsonConvert.convert<int>(json['security_clock_in']);
  if (securityClockIn != null) {
    sGAttendanceReviewWorkflowRow.securityClockIn = securityClockIn;
  }
  final int? securityClockOut = jsonConvert.convert<int>(json['security_clock_out']);
  if (securityClockOut != null) {
    sGAttendanceReviewWorkflowRow.securityClockOut = securityClockOut;
  }
  final int? workClockIn = jsonConvert.convert<int>(json['work_clock_in']);
  if (workClockIn != null) {
    sGAttendanceReviewWorkflowRow.workClockIn = workClockIn;
  }
  final int? workClockOut = jsonConvert.convert<int>(json['work_clock_out']);
  if (workClockOut != null) {
    sGAttendanceReviewWorkflowRow.workClockOut = workClockOut;
  }
  final int? securityIn = jsonConvert.convert<int>(json['security_in']);
  if (securityIn != null) {
    sGAttendanceReviewWorkflowRow.securityIn = securityIn;
  }
  final int? securityOut = jsonConvert.convert<int>(json['security_out']);
  if (securityOut != null) {
    sGAttendanceReviewWorkflowRow.securityOut = securityOut;
  }
  final int? workIn = jsonConvert.convert<int>(json['work_in']);
  if (workIn != null) {
    sGAttendanceReviewWorkflowRow.workIn = workIn;
  }
  final int? workOut = jsonConvert.convert<int>(json['work_out']);
  if (workOut != null) {
    sGAttendanceReviewWorkflowRow.workOut = workOut;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    sGAttendanceReviewWorkflowRow.status = status;
  }
  final int? remarkStatus = jsonConvert.convert<int>(json['remark_status']);
  if (remarkStatus != null) {
    sGAttendanceReviewWorkflowRow.remarkStatus = remarkStatus;
  }
  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  if (createdAt != null) {
    sGAttendanceReviewWorkflowRow.createdAt = createdAt;
  }
  final String? updatedAt = jsonConvert.convert<String>(json['updated_at']);
  if (updatedAt != null) {
    sGAttendanceReviewWorkflowRow.updatedAt = updatedAt;
  }
  final String? agencyRate = jsonConvert.convert<String>(json['agency_rate']);
  if (agencyRate != null) {
    sGAttendanceReviewWorkflowRow.agencyRate = agencyRate;
  }
  final String? agencyWage = jsonConvert.convert<String>(json['agency_wage']);
  if (agencyWage != null) {
    sGAttendanceReviewWorkflowRow.agencyWage = agencyWage;
  }
  final int? amendAtt = jsonConvert.convert<int>(json['amend_att']);
  if (amendAtt != null) {
    sGAttendanceReviewWorkflowRow.amendAtt = amendAtt;
  }
  final int? targetTop = jsonConvert.convert<int>(json['target_top']);
  if (targetTop != null) {
    sGAttendanceReviewWorkflowRow.targetTop = targetTop;
  }
  final String? rejectMsg = jsonConvert.convert<String>(json['reject_msg']);
  if (rejectMsg != null) {
    sGAttendanceReviewWorkflowRow.rejectMsg = rejectMsg;
  }
  final String? reviseHours = jsonConvert.convert<String>(json['revise_hours']);
  if (reviseHours != null) {
    sGAttendanceReviewWorkflowRow.reviseHours = reviseHours;
  }
  final String? reviseGrossWage = jsonConvert.convert<String>(json['revise_gross_wage']);
  if (reviseGrossWage != null) {
    sGAttendanceReviewWorkflowRow.reviseGrossWage = reviseGrossWage;
  }
  final String? reviseAgencyWage = jsonConvert.convert<String>(json['revise_agency_wage']);
  if (reviseAgencyWage != null) {
    sGAttendanceReviewWorkflowRow.reviseAgencyWage = reviseAgencyWage;
  }
  final int? skilledWorker = jsonConvert.convert<int>(json['skilled_worker']);
  if (skilledWorker != null) {
    sGAttendanceReviewWorkflowRow.skilledWorker = skilledWorker;
  }
  final int? hotelStaff = jsonConvert.convert<int>(json['hotel_staff']);
  if (hotelStaff != null) {
    sGAttendanceReviewWorkflowRow.hotelStaff = hotelStaff;
  }
  final int? salaryStructure = jsonConvert.convert<int>(json['salary_structure']);
  if (salaryStructure != null) {
    sGAttendanceReviewWorkflowRow.salaryStructure = salaryStructure;
  }
  return sGAttendanceReviewWorkflowRow;
}

Map<String, dynamic> $SGAttendanceReviewWorkflowRowToJson(SGAttendanceReviewWorkflowRow entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['job_id'] = entity.jobId;
  data['s_id'] = entity.sId;
  data['member_id'] = entity.memberId;
  data['labourer_id'] = entity.labourerId;
  data['labourer_name'] = entity.labourerName;
  data['labourer_nric'] = entity.labourerNric;
  data['source_type'] = entity.sourceType;
  data['employer_id'] = entity.employerId;
  data['employer_name'] = entity.employerName;
  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['ballroom_id'] = entity.ballroomId;
  data['ballroom_name'] = entity.ballroomName;
  data['job_date'] = entity.jobDate;
  data['start_time'] = entity.startTime;
  data['end_time'] = entity.endTime;
  data['working_hours'] = entity.workingHours;
  data['adjust_hours'] = entity.adjustHours;
  data['total_hours'] = entity.totalHours;
  data['hourly_rate'] = entity.hourlyRate;
  data['gross_wage'] = entity.grossWage;
  data['security_clock_in'] = entity.securityClockIn;
  data['security_clock_out'] = entity.securityClockOut;
  data['work_clock_in'] = entity.workClockIn;
  data['work_clock_out'] = entity.workClockOut;
  data['security_in'] = entity.securityIn;
  data['security_out'] = entity.securityOut;
  data['work_in'] = entity.workIn;
  data['work_out'] = entity.workOut;
  data['status'] = entity.status;
  data['remark_status'] = entity.remarkStatus;
  data['created_at'] = entity.createdAt;
  data['updated_at'] = entity.updatedAt;
  data['agency_rate'] = entity.agencyRate;
  data['agency_wage'] = entity.agencyWage;
  data['amend_att'] = entity.amendAtt;
  data['target_top'] = entity.targetTop;
  data['reject_msg'] = entity.rejectMsg;
  data['revise_hours'] = entity.reviseHours;
  data['revise_gross_wage'] = entity.reviseGrossWage;
  data['revise_agency_wage'] = entity.reviseAgencyWage;
  data['skilled_worker'] = entity.skilledWorker;
  data['hotel_staff'] = entity.hotelStaff;
  data['salary_structure'] = entity.salaryStructure;
  return data;
}

extension SGAttendanceReviewWorkflowRowExtension on SGAttendanceReviewWorkflowRow {
  SGAttendanceReviewWorkflowRow copyWith({
    String? id,
    String? jobId,
    String? sId,
    String? memberId,
    String? labourerId,
    String? labourerName,
    String? labourerNric,
    int? sourceType,
    int? employerId,
    String? employerName,
    int? agencyId,
    String? agencyName,
    String? jobTitle,
    String? outletId,
    String? outletName,
    String? ballroomId,
    String? ballroomName,
    String? jobDate,
    int? startTime,
    int? endTime,
    String? workingHours,
    String? adjustHours,
    String? totalHours,
    String? hourlyRate,
    String? grossWage,
    int? securityClockIn,
    int? securityClockOut,
    int? workClockIn,
    int? workClockOut,
    int? securityIn,
    int? securityOut,
    int? workIn,
    int? workOut,
    int? status,
    int? remarkStatus,
    String? createdAt,
    String? updatedAt,
    String? agencyRate,
    String? agencyWage,
    int? amendAtt,
    int? targetTop,
    String? rejectMsg,
    String? reviseHours,
    String? reviseGrossWage,
    String? reviseAgencyWage,
    int? skilledWorker,
    int? hotelStaff,
    int? salaryStructure,
  }) {
    return SGAttendanceReviewWorkflowRow()
      ..id = id ?? this.id
      ..jobId = jobId ?? this.jobId
      ..sId = sId ?? this.sId
      ..memberId = memberId ?? this.memberId
      ..labourerId = labourerId ?? this.labourerId
      ..labourerName = labourerName ?? this.labourerName
      ..labourerNric = labourerNric ?? this.labourerNric
      ..sourceType = sourceType ?? this.sourceType
      ..employerId = employerId ?? this.employerId
      ..employerName = employerName ?? this.employerName
      ..agencyId = agencyId ?? this.agencyId
      ..agencyName = agencyName ?? this.agencyName
      ..jobTitle = jobTitle ?? this.jobTitle
      ..outletId = outletId ?? this.outletId
      ..outletName = outletName ?? this.outletName
      ..ballroomId = ballroomId ?? this.ballroomId
      ..ballroomName = ballroomName ?? this.ballroomName
      ..jobDate = jobDate ?? this.jobDate
      ..startTime = startTime ?? this.startTime
      ..endTime = endTime ?? this.endTime
      ..workingHours = workingHours ?? this.workingHours
      ..adjustHours = adjustHours ?? this.adjustHours
      ..totalHours = totalHours ?? this.totalHours
      ..hourlyRate = hourlyRate ?? this.hourlyRate
      ..grossWage = grossWage ?? this.grossWage
      ..securityClockIn = securityClockIn ?? this.securityClockIn
      ..securityClockOut = securityClockOut ?? this.securityClockOut
      ..workClockIn = workClockIn ?? this.workClockIn
      ..workClockOut = workClockOut ?? this.workClockOut
      ..securityIn = securityIn ?? this.securityIn
      ..securityOut = securityOut ?? this.securityOut
      ..workIn = workIn ?? this.workIn
      ..workOut = workOut ?? this.workOut
      ..status = status ?? this.status
      ..remarkStatus = remarkStatus ?? this.remarkStatus
      ..createdAt = createdAt ?? this.createdAt
      ..updatedAt = updatedAt ?? this.updatedAt
      ..agencyRate = agencyRate ?? this.agencyRate
      ..agencyWage = agencyWage ?? this.agencyWage
      ..amendAtt = amendAtt ?? this.amendAtt
      ..targetTop = targetTop ?? this.targetTop
      ..rejectMsg = rejectMsg ?? this.rejectMsg
      ..reviseHours = reviseHours ?? this.reviseHours
      ..reviseGrossWage = reviseGrossWage ?? this.reviseGrossWage
      ..reviseAgencyWage = reviseAgencyWage ?? this.reviseAgencyWage
      ..skilledWorker = skilledWorker ?? this.skilledWorker
      ..hotelStaff = hotelStaff ?? this.hotelStaff
      ..salaryStructure = salaryStructure ?? this.salaryStructure;
  }
}

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

Map<String, dynamic> $SGAttendanceReviewWorkflowRecordsToJson(SGAttendanceReviewWorkflowRecords entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['serial_number'] = entity.serialNumber;
  data['node_name'] = entity.nodeName;
  data['node_type_show'] = entity.nodeTypeShow;
  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 SGAttendanceReviewWorkflowRecordsExtension on SGAttendanceReviewWorkflowRecords {
  SGAttendanceReviewWorkflowRecords copyWith({
    String? serialNumber,
    String? nodeName,
    String? nodeTypeShow,
    String? statusShow,
    String? auditName,
    String? auditTime,
    String? auditMark,
    String? createdAt,
    String? assigneeTypeShow,
    String? designationShow,
  }) {
    return SGAttendanceReviewWorkflowRecords()
      ..serialNumber = serialNumber ?? this.serialNumber
      ..nodeName = nodeName ?? this.nodeName
      ..nodeTypeShow = nodeTypeShow ?? this.nodeTypeShow
      ..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;
  }
}