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

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

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

extension SGAttendanceReviewTableEntityExtension on SGAttendanceReviewTableEntity {
  SGAttendanceReviewTableEntity copyWith({
    int? total,
    List<SGAttendanceReviewTableRows>? rows,
  }) {
    return SGAttendanceReviewTableEntity()
      ..total = total ?? this.total
      ..rows = rows ?? this.rows;
  }
}

SGAttendanceReviewTableRows $SGAttendanceReviewTableRowsFromJson(Map<String, dynamic> json) {
  final SGAttendanceReviewTableRows sGAttendanceReviewTableRows = SGAttendanceReviewTableRows();
  final String? recordId = jsonConvert.convert<String>(json['record_id']);
  if (recordId != null) {
    sGAttendanceReviewTableRows.recordId = recordId;
  }
  final String? orderId = jsonConvert.convert<String>(json['order_id']);
  if (orderId != null) {
    sGAttendanceReviewTableRows.orderId = orderId;
  }
  final String? appliedId = jsonConvert.convert<String>(json['applied_id']);
  if (appliedId != null) {
    sGAttendanceReviewTableRows.appliedId = appliedId;
  }
  final String? staffName = jsonConvert.convert<String>(json['staff_name']);
  if (staffName != null) {
    sGAttendanceReviewTableRows.staffName = staffName;
  }
  final String? source = jsonConvert.convert<String>(json['source']);
  if (source != null) {
    sGAttendanceReviewTableRows.source = source;
  }
  final String? statusShow = jsonConvert.convert<String>(json['status_show']);
  if (statusShow != null) {
    sGAttendanceReviewTableRows.statusShow = statusShow;
  }
  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  if (createdAt != null) {
    sGAttendanceReviewTableRows.createdAt = createdAt;
  }
  final String? jobDate = jsonConvert.convert<String>(json['job_date']);
  if (jobDate != null) {
    sGAttendanceReviewTableRows.jobDate = jobDate;
  }
  final String? outletName = jsonConvert.convert<String>(json['outlet_name']);
  if (outletName != null) {
    sGAttendanceReviewTableRows.outletName = outletName;
  }
  final String? jobTitle = jsonConvert.convert<String>(json['job_title']);
  if (jobTitle != null) {
    sGAttendanceReviewTableRows.jobTitle = jobTitle;
  }
  final String? jobTime = jsonConvert.convert<String>(json['job_time']);
  if (jobTime != null) {
    sGAttendanceReviewTableRows.jobTime = jobTime;
  }
  final String? adjustHours = jsonConvert.convert<String>(json['adjust_hours']);
  if (adjustHours != null) {
    sGAttendanceReviewTableRows.adjustHours = adjustHours;
  }
  final String? totalHours = jsonConvert.convert<String>(json['total_hours']);
  if (totalHours != null) {
    sGAttendanceReviewTableRows.totalHours = totalHours;
  }
  final SGAttendanceReviewTableRowsCheck? securityIn = jsonConvert.convert<SGAttendanceReviewTableRowsCheck>(json['security_in']);
  if (securityIn != null) {
    sGAttendanceReviewTableRows.securityIn = securityIn;
  }
  final SGAttendanceReviewTableRowsCheck? securityOut = jsonConvert.convert<SGAttendanceReviewTableRowsCheck>(json['security_out']);
  if (securityOut != null) {
    sGAttendanceReviewTableRows.securityOut = securityOut;
  }
  final SGAttendanceReviewTableRowsCheck? workIn = jsonConvert.convert<SGAttendanceReviewTableRowsCheck>(json['work_in']);
  if (workIn != null) {
    sGAttendanceReviewTableRows.workIn = workIn;
  }
  final SGAttendanceReviewTableRowsCheck? workOut = jsonConvert.convert<SGAttendanceReviewTableRowsCheck>(json['work_out']);
  if (workOut != null) {
    sGAttendanceReviewTableRows.workOut = workOut;
  }
  final int? sIn = jsonConvert.convert<int>(json['s_in']);
  if (sIn != null) {
    sGAttendanceReviewTableRows.sIn = sIn;
  }
  final int? sOut = jsonConvert.convert<int>(json['s_out']);
  if (sOut != null) {
    sGAttendanceReviewTableRows.sOut = sOut;
  }
  final int? wIn = jsonConvert.convert<int>(json['w_in']);
  if (wIn != null) {
    sGAttendanceReviewTableRows.wIn = wIn;
  }
  final int? wOut = jsonConvert.convert<int>(json['w_out']);
  if (wOut != null) {
    sGAttendanceReviewTableRows.wOut = wOut;
  }
  final bool? isSelected = jsonConvert.convert<bool>(json['isSelected']);
  if (isSelected != null) {
    sGAttendanceReviewTableRows.isSelected = isSelected;
  }
  return sGAttendanceReviewTableRows;
}

Map<String, dynamic> $SGAttendanceReviewTableRowsToJson(SGAttendanceReviewTableRows entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['record_id'] = entity.recordId;
  data['order_id'] = entity.orderId;
  data['applied_id'] = entity.appliedId;
  data['staff_name'] = entity.staffName;
  data['source'] = entity.source;
  data['status_show'] = entity.statusShow;
  data['created_at'] = entity.createdAt;
  data['job_date'] = entity.jobDate;
  data['outlet_name'] = entity.outletName;
  data['job_title'] = entity.jobTitle;
  data['job_time'] = entity.jobTime;
  data['adjust_hours'] = entity.adjustHours;
  data['total_hours'] = entity.totalHours;
  data['security_in'] = entity.securityIn?.toJson();
  data['security_out'] = entity.securityOut?.toJson();
  data['work_in'] = entity.workIn?.toJson();
  data['work_out'] = entity.workOut?.toJson();
  data['s_in'] = entity.sIn;
  data['s_out'] = entity.sOut;
  data['w_in'] = entity.wIn;
  data['w_out'] = entity.wOut;
  data['isSelected'] = entity.isSelected;
  return data;
}

extension SGAttendanceReviewTableRowsExtension on SGAttendanceReviewTableRows {
  SGAttendanceReviewTableRows copyWith({
    String? recordId,
    String? orderId,
    String? appliedId,
    String? staffName,
    String? source,
    String? statusShow,
    String? createdAt,
    String? jobDate,
    String? outletName,
    String? jobTitle,
    String? jobTime,
    String? adjustHours,
    String? totalHours,
    SGAttendanceReviewTableRowsCheck? securityIn,
    SGAttendanceReviewTableRowsCheck? securityOut,
    SGAttendanceReviewTableRowsCheck? workIn,
    SGAttendanceReviewTableRowsCheck? workOut,
    int? sIn,
    int? sOut,
    int? wIn,
    int? wOut,
    bool? isSelected,
  }) {
    return SGAttendanceReviewTableRows()
      ..recordId = recordId ?? this.recordId
      ..orderId = orderId ?? this.orderId
      ..appliedId = appliedId ?? this.appliedId
      ..staffName = staffName ?? this.staffName
      ..source = source ?? this.source
      ..statusShow = statusShow ?? this.statusShow
      ..createdAt = createdAt ?? this.createdAt
      ..jobDate = jobDate ?? this.jobDate
      ..outletName = outletName ?? this.outletName
      ..jobTitle = jobTitle ?? this.jobTitle
      ..jobTime = jobTime ?? this.jobTime
      ..adjustHours = adjustHours ?? this.adjustHours
      ..totalHours = totalHours ?? this.totalHours
      ..securityIn = securityIn ?? this.securityIn
      ..securityOut = securityOut ?? this.securityOut
      ..workIn = workIn ?? this.workIn
      ..workOut = workOut ?? this.workOut
      ..sIn = sIn ?? this.sIn
      ..sOut = sOut ?? this.sOut
      ..wIn = wIn ?? this.wIn
      ..wOut = wOut ?? this.wOut
      ..isSelected = isSelected ?? this.isSelected;
  }
}

SGAttendanceReviewTableRowsCheck $SGAttendanceReviewTableRowsCheckFromJson(Map<String, dynamic> json) {
  final SGAttendanceReviewTableRowsCheck sGAttendanceReviewTableRowsCheck = SGAttendanceReviewTableRowsCheck();
  final String? time = jsonConvert.convert<String>(json['time']);
  if (time != null) {
    sGAttendanceReviewTableRowsCheck.time = time;
  }
  final String? temp = jsonConvert.convert<String>(json['temp']);
  if (temp != null) {
    sGAttendanceReviewTableRowsCheck.temp = temp;
  }
  final String? image = jsonConvert.convert<String>(json['image']);
  if (image != null) {
    sGAttendanceReviewTableRowsCheck.image = image;
  }
  final int? changed = jsonConvert.convert<int>(json['changed']);
  if (changed != null) {
    sGAttendanceReviewTableRowsCheck.changed = changed;
  }
  final String? key = jsonConvert.convert<String>(json['key']);
  if (key != null) {
    sGAttendanceReviewTableRowsCheck.key = key;
  }
  final String? color = jsonConvert.convert<String>(json['color']);
  if (color != null) {
    sGAttendanceReviewTableRowsCheck.color = color;
  }
  return sGAttendanceReviewTableRowsCheck;
}

Map<String, dynamic> $SGAttendanceReviewTableRowsCheckToJson(SGAttendanceReviewTableRowsCheck entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['time'] = entity.time;
  data['temp'] = entity.temp;
  data['image'] = entity.image;
  data['changed'] = entity.changed;
  data['key'] = entity.key;
  data['color'] = entity.color;
  return data;
}

extension SGAttendanceReviewTableRowsCheckExtension on SGAttendanceReviewTableRowsCheck {
  SGAttendanceReviewTableRowsCheck copyWith({
    String? time,
    String? temp,
    String? image,
    int? changed,
    String? key,
    String? color,
  }) {
    return SGAttendanceReviewTableRowsCheck()
      ..time = time ?? this.time
      ..temp = temp ?? this.temp
      ..image = image ?? this.image
      ..changed = changed ?? this.changed
      ..key = key ?? this.key
      ..color = color ?? this.color;
  }
}