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

ContractPositionRateDetailEntity $ContractPositionRateDetailEntityFromJson(Map<String, dynamic> json) {
  final ContractPositionRateDetailEntity contractPositionRateDetailEntity = ContractPositionRateDetailEntity();
  final String? positionId = jsonConvert.convert<String>(json['position_id']);
  if (positionId != null) {
    contractPositionRateDetailEntity.positionId = positionId;
  }
  final String? agencyName = jsonConvert.convert<String>(json['agency_name']);
  if (agencyName != null) {
    contractPositionRateDetailEntity.agencyName = agencyName;
  }
  final String? position = jsonConvert.convert<String>(json['position']);
  if (position != null) {
    contractPositionRateDetailEntity.position = position;
  }
  final String? contractId = jsonConvert.convert<String>(json['contract_id']);
  if (contractId != null) {
    contractPositionRateDetailEntity.contractId = contractId;
  }
  final String? type1 = jsonConvert.convert<String>(json['type_1']);
  if (type1 != null) {
    contractPositionRateDetailEntity.type1 = type1;
  }
  final String? type2 = jsonConvert.convert<String>(json['type_2']);
  if (type2 != null) {
    contractPositionRateDetailEntity.type2 = type2;
  }
  final String? type3 = jsonConvert.convert<String>(json['type_3']);
  if (type3 != null) {
    contractPositionRateDetailEntity.type3 = type3;
  }
  final String? type7 = jsonConvert.convert<String>(json['type_7']);
  if (type7 != null) {
    contractPositionRateDetailEntity.type7 = type7;
  }
  final String? type8 = jsonConvert.convert<String>(json['type_8']);
  if (type8 != null) {
    contractPositionRateDetailEntity.type8 = type8;
  }
  final String? type9 = jsonConvert.convert<String>(json['type_9']);
  if (type9 != null) {
    contractPositionRateDetailEntity.type9 = type9;
  }
  final String? type10 = jsonConvert.convert<String>(json['type_10']);
  if (type10 != null) {
    contractPositionRateDetailEntity.type10 = type10;
  }
  final String? type11 = jsonConvert.convert<String>(json['type_11']);
  if (type11 != null) {
    contractPositionRateDetailEntity.type11 = type11;
  }
  final String? type12 = jsonConvert.convert<String>(json['type_12']);
  if (type12 != null) {
    contractPositionRateDetailEntity.type12 = type12;
  }
  final String? type13 = jsonConvert.convert<String>(json['type_13']);
  if (type13 != null) {
    contractPositionRateDetailEntity.type13 = type13;
  }
  final String? type20 = jsonConvert.convert<String>(json['type_20']);
  if (type20 != null) {
    contractPositionRateDetailEntity.type20 = type20;
  }
  final String? type21 = jsonConvert.convert<String>(json['type_21']);
  if (type21 != null) {
    contractPositionRateDetailEntity.type21 = type21;
  }
  return contractPositionRateDetailEntity;
}

Map<String, dynamic> $ContractPositionRateDetailEntityToJson(ContractPositionRateDetailEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['position_id'] = entity.positionId;
  data['agency_name'] = entity.agencyName;
  data['position'] = entity.position;
  data['contract_id'] = entity.contractId;
  data['type_1'] = entity.type1;
  data['type_2'] = entity.type2;
  data['type_3'] = entity.type3;
  data['type_7'] = entity.type7;
  data['type_8'] = entity.type8;
  data['type_9'] = entity.type9;
  data['type_10'] = entity.type10;
  data['type_11'] = entity.type11;
  data['type_12'] = entity.type12;
  data['type_13'] = entity.type13;
  data['type_20'] = entity.type20;
  data['type_21'] = entity.type21;
  return data;
}

extension ContractPositionRateDetailEntityExtension on ContractPositionRateDetailEntity {
  ContractPositionRateDetailEntity copyWith({
    String? positionId,
    String? agencyName,
    String? position,
    String? contractId,
    String? type1,
    String? type2,
    String? type3,
    String? type7,
    String? type8,
    String? type9,
    String? type10,
    String? type11,
    String? type12,
    String? type13,
    String? type20,
    String? type21,
  }) {
    return ContractPositionRateDetailEntity()
      ..positionId = positionId ?? this.positionId
      ..agencyName = agencyName ?? this.agencyName
      ..position = position ?? this.position
      ..contractId = contractId ?? this.contractId
      ..type1 = type1 ?? this.type1
      ..type2 = type2 ?? this.type2
      ..type3 = type3 ?? this.type3
      ..type7 = type7 ?? this.type7
      ..type8 = type8 ?? this.type8
      ..type9 = type9 ?? this.type9
      ..type10 = type10 ?? this.type10
      ..type11 = type11 ?? this.type11
      ..type12 = type12 ?? this.type12
      ..type13 = type13 ?? this.type13
      ..type20 = type20 ?? this.type20
      ..type21 = type21 ?? this.type21;
  }
}