import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/response/attendance_entity.dart'; AttendanceEntity $AttendanceEntityFromJson(Map json) { final AttendanceEntity attendanceEntity = AttendanceEntity(); final int? total = jsonConvert.convert(json['total']); if (total != null) { attendanceEntity.total = total; } final List? rows = (json['rows'] as List?)?.map( (e) => jsonConvert.convert(e) as AttendanceList).toList(); if (rows != null) { attendanceEntity.rows = rows; } return attendanceEntity; } Map $AttendanceEntityToJson(AttendanceEntity entity) { final Map data = {}; data['total'] = entity.total; data['rows'] = entity.rows?.map((v) => v.toJson()).toList(); return data; } extension AttendanceEntityExtension on AttendanceEntity { AttendanceEntity copyWith({ int? total, List? rows, }) { return AttendanceEntity() ..total = total ?? this.total ..rows = rows ?? this.rows; } } AttendanceList $AttendanceListFromJson(Map json) { final AttendanceList attendanceList = AttendanceList(); final int? appliedId = jsonConvert.convert(json['applied_id']); if (appliedId != null) { attendanceList.appliedId = appliedId; } final int? staffId = jsonConvert.convert(json['staff_id']); if (staffId != null) { attendanceList.staffId = staffId; } final String? staffName = jsonConvert.convert(json['staff_name']); if (staffName != null) { attendanceList.staffName = staffName; } final String? jobDate = jsonConvert.convert(json['job_date']); if (jobDate != null) { attendanceList.jobDate = jobDate; } final String? startTime = jsonConvert.convert(json['start_time']); if (startTime != null) { attendanceList.startTime = startTime; } final String? endTime = jsonConvert.convert(json['end_time']); if (endTime != null) { attendanceList.endTime = endTime; } final int? checkInId = jsonConvert.convert(json['check_in_id']); if (checkInId != null) { attendanceList.checkInId = checkInId; } final String? checkInTime = jsonConvert.convert(json['check_in_time']); if (checkInTime != null) { attendanceList.checkInTime = checkInTime; } final String? checkInImg = jsonConvert.convert(json['check_in_img']); if (checkInImg != null) { attendanceList.checkInImg = checkInImg; } final int? checkOutId = jsonConvert.convert(json['check_out_id']); if (checkOutId != null) { attendanceList.checkOutId = checkOutId; } final String? checkOutTime = jsonConvert.convert(json['check_out_time']); if (checkOutTime != null) { attendanceList.checkOutTime = checkOutTime; } final String? checkOutImg = jsonConvert.convert(json['check_out_img']); if (checkOutImg != null) { attendanceList.checkOutImg = checkOutImg; } final int? status = jsonConvert.convert(json['status']); if (status != null) { attendanceList.status = status; } final String? statusShow = jsonConvert.convert(json['status_show']); if (statusShow != null) { attendanceList.statusShow = statusShow; } final bool? isExpended = jsonConvert.convert(json['isExpended']); if (isExpended != null) { attendanceList.isExpended = isExpended; } return attendanceList; } Map $AttendanceListToJson(AttendanceList entity) { final Map data = {}; data['applied_id'] = entity.appliedId; data['staff_id'] = entity.staffId; data['staff_name'] = entity.staffName; data['job_date'] = entity.jobDate; data['start_time'] = entity.startTime; data['end_time'] = entity.endTime; data['check_in_id'] = entity.checkInId; data['check_in_time'] = entity.checkInTime; data['check_in_img'] = entity.checkInImg; data['check_out_id'] = entity.checkOutId; data['check_out_time'] = entity.checkOutTime; data['check_out_img'] = entity.checkOutImg; data['status'] = entity.status; data['status_show'] = entity.statusShow; data['isExpended'] = entity.isExpended; return data; } extension AttendanceListExtension on AttendanceList { AttendanceList copyWith({ int? appliedId, int? staffId, String? staffName, String? jobDate, String? startTime, String? endTime, int? checkInId, String? checkInTime, String? checkInImg, int? checkOutId, String? checkOutTime, String? checkOutImg, int? status, String? statusShow, bool? isExpended, }) { return AttendanceList() ..appliedId = appliedId ?? this.appliedId ..staffId = staffId ?? this.staffId ..staffName = staffName ?? this.staffName ..jobDate = jobDate ?? this.jobDate ..startTime = startTime ?? this.startTime ..endTime = endTime ?? this.endTime ..checkInId = checkInId ?? this.checkInId ..checkInTime = checkInTime ?? this.checkInTime ..checkInImg = checkInImg ?? this.checkInImg ..checkOutId = checkOutId ?? this.checkOutId ..checkOutTime = checkOutTime ?? this.checkOutTime ..checkOutImg = checkOutImg ?? this.checkOutImg ..status = status ?? this.status ..statusShow = statusShow ?? this.statusShow ..isExpended = isExpended ?? this.isExpended; } }