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? count = jsonConvert.convert(json['count']); if (count != null) { attendanceEntity.count = count; } final int? curPage = jsonConvert.convert(json['curPage']); if (curPage != null) { attendanceEntity.curPage = curPage; } final int? pageSize = jsonConvert.convert(json['pageSize']); if (pageSize != null) { attendanceEntity.pageSize = pageSize; } final int? countPage = jsonConvert.convert(json['countPage']); if (countPage != null) { attendanceEntity.countPage = countPage; } final List? list = (json['list'] as List?)?.map( (e) => jsonConvert.convert(e) as AttendanceList).toList(); if (list != null) { attendanceEntity.list = list; } return attendanceEntity; } Map $AttendanceEntityToJson(AttendanceEntity entity) { final Map data = {}; data['count'] = entity.count; data['curPage'] = entity.curPage; data['pageSize'] = entity.pageSize; data['countPage'] = entity.countPage; data['list'] = entity.list?.map((v) => v.toJson()).toList(); return data; } extension AttendanceEntityExtension on AttendanceEntity { AttendanceEntity copyWith({ int? count, int? curPage, int? pageSize, int? countPage, List? list, }) { return AttendanceEntity() ..count = count ?? this.count ..curPage = curPage ?? this.curPage ..pageSize = pageSize ?? this.pageSize ..countPage = countPage ?? this.countPage ..list = list ?? this.list; } } 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; } }