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

THOALabourReviewTableEntity $THOALabourReviewTableEntityFromJson(Map<String, dynamic> json) {
  final THOALabourReviewTableEntity tHOALabourReviewTableEntity = THOALabourReviewTableEntity();
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    tHOALabourReviewTableEntity.total = total;
  }
  final List<THOALabourReviewTableRows>? rows = (json['rows'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<THOALabourReviewTableRows>(e) as THOALabourReviewTableRows).toList();
  if (rows != null) {
    tHOALabourReviewTableEntity.rows = rows;
  }
  return tHOALabourReviewTableEntity;
}

Map<String, dynamic> $THOALabourReviewTableEntityToJson(THOALabourReviewTableEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['total'] = entity.total;
  data['rows'] = entity.rows.map((v) => v.toJson()).toList();
  return data;
}

extension THOALabourReviewTableEntityExtension on THOALabourReviewTableEntity {
  THOALabourReviewTableEntity copyWith({
    int? total,
    List<THOALabourReviewTableRows>? rows,
  }) {
    return THOALabourReviewTableEntity()
      ..total = total ?? this.total
      ..rows = rows ?? this.rows;
  }
}

THOALabourReviewTableRows $THOALabourReviewTableRowsFromJson(Map<String, dynamic> json) {
  final THOALabourReviewTableRows tHOALabourReviewTableRows = THOALabourReviewTableRows();
  final String? recordId = jsonConvert.convert<String>(json['record_id']);
  if (recordId != null) {
    tHOALabourReviewTableRows.recordId = recordId;
  }
  final String? orderId = jsonConvert.convert<String>(json['order_id']);
  if (orderId != null) {
    tHOALabourReviewTableRows.orderId = orderId;
  }
  final String? requestId = jsonConvert.convert<String>(json['request_id']);
  if (requestId != null) {
    tHOALabourReviewTableRows.requestId = requestId;
  }
  final String? statusShow = jsonConvert.convert<String>(json['status_show']);
  if (statusShow != null) {
    tHOALabourReviewTableRows.statusShow = statusShow;
  }
  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  if (createdAt != null) {
    tHOALabourReviewTableRows.createdAt = createdAt;
  }
  final String? sourceShow = jsonConvert.convert<String>(json['source_show']);
  if (sourceShow != null) {
    tHOALabourReviewTableRows.sourceShow = sourceShow;
  }
  final String? jobDate = jsonConvert.convert<String>(json['job_date']);
  if (jobDate != null) {
    tHOALabourReviewTableRows.jobDate = jobDate;
  }
  final String? outletName = jsonConvert.convert<String>(json['outlet_name']);
  if (outletName != null) {
    tHOALabourReviewTableRows.outletName = outletName;
  }
  final String? jobTitle = jsonConvert.convert<String>(json['job_title']);
  if (jobTitle != null) {
    tHOALabourReviewTableRows.jobTitle = jobTitle;
  }
  final String? hourlyRate = jsonConvert.convert<String>(json['hourly_rate']);
  if (hourlyRate != null) {
    tHOALabourReviewTableRows.hourlyRate = hourlyRate;
  }
  final String? startTime = jsonConvert.convert<String>(json['start_time']);
  if (startTime != null) {
    tHOALabourReviewTableRows.startTime = startTime;
  }
  final String? endTime = jsonConvert.convert<String>(json['end_time']);
  if (endTime != null) {
    tHOALabourReviewTableRows.endTime = endTime;
  }
  final int? hiringNum = jsonConvert.convert<int>(json['hiring_num']);
  if (hiringNum != null) {
    tHOALabourReviewTableRows.hiringNum = hiringNum;
  }
  final int? attNum = jsonConvert.convert<int>(json['att_num']);
  if (attNum != null) {
    tHOALabourReviewTableRows.attNum = attNum;
  }
  final String? positionName = jsonConvert.convert<String>(json['position_name']);
  if (positionName != null) {
    tHOALabourReviewTableRows.positionName = positionName;
  }
  final int? isOt = jsonConvert.convert<int>(json['is_ot']);
  if (isOt != null) {
    tHOALabourReviewTableRows.isOt = isOt;
  }
  final bool? isSelected = jsonConvert.convert<bool>(json['isSelected']);
  if (isSelected != null) {
    tHOALabourReviewTableRows.isSelected = isSelected;
  }
  return tHOALabourReviewTableRows;
}

Map<String, dynamic> $THOALabourReviewTableRowsToJson(THOALabourReviewTableRows entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['record_id'] = entity.recordId;
  data['order_id'] = entity.orderId;
  data['request_id'] = entity.requestId;
  data['status_show'] = entity.statusShow;
  data['created_at'] = entity.createdAt;
  data['source_show'] = entity.sourceShow;
  data['job_date'] = entity.jobDate;
  data['outlet_name'] = entity.outletName;
  data['job_title'] = entity.jobTitle;
  data['hourly_rate'] = entity.hourlyRate;
  data['start_time'] = entity.startTime;
  data['end_time'] = entity.endTime;
  data['hiring_num'] = entity.hiringNum;
  data['att_num'] = entity.attNum;
  data['position_name'] = entity.positionName;
  data['is_ot'] = entity.isOt;
  data['isSelected'] = entity.isSelected;
  return data;
}

extension THOALabourReviewTableRowsExtension on THOALabourReviewTableRows {
  THOALabourReviewTableRows copyWith({
    String? recordId,
    String? orderId,
    String? requestId,
    String? statusShow,
    String? createdAt,
    String? sourceShow,
    String? jobDate,
    String? outletName,
    String? jobTitle,
    String? hourlyRate,
    String? startTime,
    String? endTime,
    int? hiringNum,
    int? attNum,
    String? positionName,
    int? isOt,
    bool? isSelected,
  }) {
    return THOALabourReviewTableRows()
      ..recordId = recordId ?? this.recordId
      ..orderId = orderId ?? this.orderId
      ..requestId = requestId ?? this.requestId
      ..statusShow = statusShow ?? this.statusShow
      ..createdAt = createdAt ?? this.createdAt
      ..sourceShow = sourceShow ?? this.sourceShow
      ..jobDate = jobDate ?? this.jobDate
      ..outletName = outletName ?? this.outletName
      ..jobTitle = jobTitle ?? this.jobTitle
      ..hourlyRate = hourlyRate ?? this.hourlyRate
      ..startTime = startTime ?? this.startTime
      ..endTime = endTime ?? this.endTime
      ..hiringNum = hiringNum ?? this.hiringNum
      ..attNum = attNum ?? this.attNum
      ..positionName = positionName ?? this.positionName
      ..isOt = isOt ?? this.isOt
      ..isSelected = isSelected ?? this.isSelected;
  }
}