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

JobAppliedEditIndexSGEntity $JobAppliedEditIndexSGEntityFromJson(Map<String, dynamic> json) {
  final JobAppliedEditIndexSGEntity jobAppliedEditIndexSGEntity = JobAppliedEditIndexSGEntity();
  final String? appliedId = jsonConvert.convert<String>(json['applied_id']);
  if (appliedId != null) {
    jobAppliedEditIndexSGEntity.appliedId = appliedId;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    jobAppliedEditIndexSGEntity.status = status;
  }
  final String? startTime = jsonConvert.convert<String>(json['start_time']);
  if (startTime != null) {
    jobAppliedEditIndexSGEntity.startTime = startTime;
  }
  final String? endTime = jsonConvert.convert<String>(json['end_time']);
  if (endTime != null) {
    jobAppliedEditIndexSGEntity.endTime = endTime;
  }
  final String? securityIn = jsonConvert.convert<String>(json['security_in']);
  if (securityIn != null) {
    jobAppliedEditIndexSGEntity.securityIn = securityIn;
  }
  final String? securityOut = jsonConvert.convert<String>(json['security_out']);
  if (securityOut != null) {
    jobAppliedEditIndexSGEntity.securityOut = securityOut;
  }
  final String? workIn = jsonConvert.convert<String>(json['work_in']);
  if (workIn != null) {
    jobAppliedEditIndexSGEntity.workIn = workIn;
  }
  final String? workOut = jsonConvert.convert<String>(json['work_out']);
  if (workOut != null) {
    jobAppliedEditIndexSGEntity.workOut = workOut;
  }
  final String? adjustHours = jsonConvert.convert<String>(json['adjust_hours']);
  if (adjustHours != null) {
    jobAppliedEditIndexSGEntity.adjustHours = adjustHours;
  }
  final List<JobAppliedEditIndexSGStatusList>? statusList = (json['status_list'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<JobAppliedEditIndexSGStatusList>(e) as JobAppliedEditIndexSGStatusList).toList();
  if (statusList != null) {
    jobAppliedEditIndexSGEntity.statusList = statusList;
  }
  return jobAppliedEditIndexSGEntity;
}

Map<String, dynamic> $JobAppliedEditIndexSGEntityToJson(JobAppliedEditIndexSGEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['applied_id'] = entity.appliedId;
  data['status'] = entity.status;
  data['start_time'] = entity.startTime;
  data['end_time'] = entity.endTime;
  data['security_in'] = entity.securityIn;
  data['security_out'] = entity.securityOut;
  data['work_in'] = entity.workIn;
  data['work_out'] = entity.workOut;
  data['adjust_hours'] = entity.adjustHours;
  data['status_list'] = entity.statusList?.map((v) => v.toJson()).toList();
  return data;
}

extension JobAppliedEditIndexSGEntityExtension on JobAppliedEditIndexSGEntity {
  JobAppliedEditIndexSGEntity copyWith({
    String? appliedId,
    int? status,
    String? startTime,
    String? endTime,
    String? securityIn,
    String? securityOut,
    String? workIn,
    String? workOut,
    String? adjustHours,
    List<JobAppliedEditIndexSGStatusList>? statusList,
  }) {
    return JobAppliedEditIndexSGEntity()
      ..appliedId = appliedId ?? this.appliedId
      ..status = status ?? this.status
      ..startTime = startTime ?? this.startTime
      ..endTime = endTime ?? this.endTime
      ..securityIn = securityIn ?? this.securityIn
      ..securityOut = securityOut ?? this.securityOut
      ..workIn = workIn ?? this.workIn
      ..workOut = workOut ?? this.workOut
      ..adjustHours = adjustHours ?? this.adjustHours
      ..statusList = statusList ?? this.statusList;
  }
}

JobAppliedEditIndexSGStatusList $JobAppliedEditIndexSGStatusListFromJson(Map<String, dynamic> json) {
  final JobAppliedEditIndexSGStatusList jobAppliedEditIndexSGStatusList = JobAppliedEditIndexSGStatusList();
  final int? value = jsonConvert.convert<int>(json['value']);
  if (value != null) {
    jobAppliedEditIndexSGStatusList.value = value;
  }
  final String? txt = jsonConvert.convert<String>(json['txt']);
  if (txt != null) {
    jobAppliedEditIndexSGStatusList.txt = txt;
  }
  final String? checked = jsonConvert.convert<String>(json['checked']);
  if (checked != null) {
    jobAppliedEditIndexSGStatusList.checked = checked;
  }
  return jobAppliedEditIndexSGStatusList;
}

Map<String, dynamic> $JobAppliedEditIndexSGStatusListToJson(JobAppliedEditIndexSGStatusList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['value'] = entity.value;
  data['txt'] = entity.txt;
  data['checked'] = entity.checked;
  return data;
}

extension JobAppliedEditIndexSGStatusListExtension on JobAppliedEditIndexSGStatusList {
  JobAppliedEditIndexSGStatusList copyWith({
    int? value,
    String? txt,
    String? checked,
  }) {
    return JobAppliedEditIndexSGStatusList()
      ..value = value ?? this.value
      ..txt = txt ?? this.txt
      ..checked = checked ?? this.checked;
  }
}