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

JobListAppliedInfoEntity $JobListAppliedInfoEntityFromJson(Map<String, dynamic> json) {
  final JobListAppliedInfoEntity jobListAppliedInfoEntity = JobListAppliedInfoEntity();
  final int? jobId = jsonConvert.convert<int>(json['job_id']);
  if (jobId != null) {
    jobListAppliedInfoEntity.jobId = jobId;
  }
  final String? jobTitle = jsonConvert.convert<String>(json['job_title']);
  if (jobTitle != null) {
    jobListAppliedInfoEntity.jobTitle = jobTitle;
  }
  final String? department = jsonConvert.convert<String>(json['department']);
  if (department != null) {
    jobListAppliedInfoEntity.department = department;
  }
  final String? jobUnit = jsonConvert.convert<String>(json['job_unit']);
  if (jobUnit != null) {
    jobListAppliedInfoEntity.jobUnit = jobUnit;
  }
  final String? jobDate = jsonConvert.convert<String>(json['job_date']);
  if (jobDate != null) {
    jobListAppliedInfoEntity.jobDate = jobDate;
  }
  final bool? canAppend = jsonConvert.convert<bool>(json['can_append']);
  if (canAppend != null) {
    jobListAppliedInfoEntity.canAppend = canAppend;
  }
  final String? startTime = jsonConvert.convert<String>(json['start_time']);
  if (startTime != null) {
    jobListAppliedInfoEntity.startTime = startTime;
  }
  final String? endTime = jsonConvert.convert<String>(json['end_time']);
  if (endTime != null) {
    jobListAppliedInfoEntity.endTime = endTime;
  }
  return jobListAppliedInfoEntity;
}

Map<String, dynamic> $JobListAppliedInfoEntityToJson(JobListAppliedInfoEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['job_id'] = entity.jobId;
  data['job_title'] = entity.jobTitle;
  data['department'] = entity.department;
  data['job_unit'] = entity.jobUnit;
  data['job_date'] = entity.jobDate;
  data['can_append'] = entity.canAppend;
  data['start_time'] = entity.startTime;
  data['end_time'] = entity.endTime;
  return data;
}

extension JobListAppliedInfoEntityExtension on JobListAppliedInfoEntity {
  JobListAppliedInfoEntity copyWith({
    int? jobId,
    String? jobTitle,
    String? department,
    String? jobUnit,
    String? jobDate,
    bool? canAppend,
    String? startTime,
    String? endTime,
  }) {
    return JobListAppliedInfoEntity()
      ..jobId = jobId ?? this.jobId
      ..jobTitle = jobTitle ?? this.jobTitle
      ..department = department ?? this.department
      ..jobUnit = jobUnit ?? this.jobUnit
      ..jobDate = jobDate ?? this.jobDate
      ..canAppend = canAppend ?? this.canAppend
      ..startTime = startTime ?? this.startTime
      ..endTime = endTime ?? this.endTime;
  }
}