attendance_entity.g.dart 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/response/attendance_entity.dart';
  3. AttendanceEntity $AttendanceEntityFromJson(Map<String, dynamic> json) {
  4. final AttendanceEntity attendanceEntity = AttendanceEntity();
  5. final int? total = jsonConvert.convert<int>(json['total']);
  6. if (total != null) {
  7. attendanceEntity.total = total;
  8. }
  9. final List<AttendanceList>? rows = (json['rows'] as List<dynamic>?)
  10. ?.map(
  11. (e) => jsonConvert.convert<AttendanceList>(e) as AttendanceList)
  12. .toList();
  13. if (rows != null) {
  14. attendanceEntity.rows = rows;
  15. }
  16. return attendanceEntity;
  17. }
  18. Map<String, dynamic> $AttendanceEntityToJson(AttendanceEntity entity) {
  19. final Map<String, dynamic> data = <String, dynamic>{};
  20. data['total'] = entity.total;
  21. data['rows'] = entity.rows?.map((v) => v.toJson()).toList();
  22. return data;
  23. }
  24. extension AttendanceEntityExtension on AttendanceEntity {
  25. AttendanceEntity copyWith({
  26. int? total,
  27. List<AttendanceList>? rows,
  28. }) {
  29. return AttendanceEntity()
  30. ..total = total ?? this.total
  31. ..rows = rows ?? this.rows;
  32. }
  33. }
  34. AttendanceList $AttendanceListFromJson(Map<String, dynamic> json) {
  35. final AttendanceList attendanceList = AttendanceList();
  36. final int? appliedId = jsonConvert.convert<int>(json['applied_id']);
  37. if (appliedId != null) {
  38. attendanceList.appliedId = appliedId;
  39. }
  40. final int? staffId = jsonConvert.convert<int>(json['staff_id']);
  41. if (staffId != null) {
  42. attendanceList.staffId = staffId;
  43. }
  44. final String? staffName = jsonConvert.convert<String>(json['staff_name']);
  45. if (staffName != null) {
  46. attendanceList.staffName = staffName;
  47. }
  48. final String? jobDate = jsonConvert.convert<String>(json['job_date']);
  49. if (jobDate != null) {
  50. attendanceList.jobDate = jobDate;
  51. }
  52. final String? startTime = jsonConvert.convert<String>(json['start_time']);
  53. if (startTime != null) {
  54. attendanceList.startTime = startTime;
  55. }
  56. final String? endTime = jsonConvert.convert<String>(json['end_time']);
  57. if (endTime != null) {
  58. attendanceList.endTime = endTime;
  59. }
  60. final String? securityIn = jsonConvert.convert<String>(json['security_in']);
  61. if (securityIn != null) {
  62. attendanceList.securityIn = securityIn;
  63. }
  64. final String? securityOut = jsonConvert.convert<String>(json['security_out']);
  65. if (securityOut != null) {
  66. attendanceList.securityOut = securityOut;
  67. }
  68. final int? checkInId = jsonConvert.convert<int>(json['check_in_id']);
  69. if (checkInId != null) {
  70. attendanceList.checkInId = checkInId;
  71. }
  72. final String? checkInTime = jsonConvert.convert<String>(
  73. json['check_in_time']);
  74. if (checkInTime != null) {
  75. attendanceList.checkInTime = checkInTime;
  76. }
  77. final String? checkInImg = jsonConvert.convert<String>(json['check_in_img']);
  78. if (checkInImg != null) {
  79. attendanceList.checkInImg = checkInImg;
  80. }
  81. final int? checkOutId = jsonConvert.convert<int>(json['check_out_id']);
  82. if (checkOutId != null) {
  83. attendanceList.checkOutId = checkOutId;
  84. }
  85. final String? checkOutTime = jsonConvert.convert<String>(
  86. json['check_out_time']);
  87. if (checkOutTime != null) {
  88. attendanceList.checkOutTime = checkOutTime;
  89. }
  90. final String? checkOutImg = jsonConvert.convert<String>(
  91. json['check_out_img']);
  92. if (checkOutImg != null) {
  93. attendanceList.checkOutImg = checkOutImg;
  94. }
  95. final int? status = jsonConvert.convert<int>(json['status']);
  96. if (status != null) {
  97. attendanceList.status = status;
  98. }
  99. final String? statusShow = jsonConvert.convert<String>(json['status_show']);
  100. if (statusShow != null) {
  101. attendanceList.statusShow = statusShow;
  102. }
  103. final bool? isExpended = jsonConvert.convert<bool>(json['isExpended']);
  104. if (isExpended != null) {
  105. attendanceList.isExpended = isExpended;
  106. }
  107. return attendanceList;
  108. }
  109. Map<String, dynamic> $AttendanceListToJson(AttendanceList entity) {
  110. final Map<String, dynamic> data = <String, dynamic>{};
  111. data['applied_id'] = entity.appliedId;
  112. data['staff_id'] = entity.staffId;
  113. data['staff_name'] = entity.staffName;
  114. data['job_date'] = entity.jobDate;
  115. data['start_time'] = entity.startTime;
  116. data['end_time'] = entity.endTime;
  117. data['security_in'] = entity.securityIn;
  118. data['security_out'] = entity.securityOut;
  119. data['check_in_id'] = entity.checkInId;
  120. data['check_in_time'] = entity.checkInTime;
  121. data['check_in_img'] = entity.checkInImg;
  122. data['check_out_id'] = entity.checkOutId;
  123. data['check_out_time'] = entity.checkOutTime;
  124. data['check_out_img'] = entity.checkOutImg;
  125. data['status'] = entity.status;
  126. data['status_show'] = entity.statusShow;
  127. data['isExpended'] = entity.isExpended;
  128. return data;
  129. }
  130. extension AttendanceListExtension on AttendanceList {
  131. AttendanceList copyWith({
  132. int? appliedId,
  133. int? staffId,
  134. String? staffName,
  135. String? jobDate,
  136. String? startTime,
  137. String? endTime,
  138. String? securityIn,
  139. String? securityOut,
  140. int? checkInId,
  141. String? checkInTime,
  142. String? checkInImg,
  143. int? checkOutId,
  144. String? checkOutTime,
  145. String? checkOutImg,
  146. int? status,
  147. String? statusShow,
  148. bool? isExpended,
  149. }) {
  150. return AttendanceList()
  151. ..appliedId = appliedId ?? this.appliedId
  152. ..staffId = staffId ?? this.staffId
  153. ..staffName = staffName ?? this.staffName
  154. ..jobDate = jobDate ?? this.jobDate
  155. ..startTime = startTime ?? this.startTime
  156. ..endTime = endTime ?? this.endTime
  157. ..securityIn = securityIn ?? this.securityIn
  158. ..securityOut = securityOut ?? this.securityOut
  159. ..checkInId = checkInId ?? this.checkInId
  160. ..checkInTime = checkInTime ?? this.checkInTime
  161. ..checkInImg = checkInImg ?? this.checkInImg
  162. ..checkOutId = checkOutId ?? this.checkOutId
  163. ..checkOutTime = checkOutTime ?? this.checkOutTime
  164. ..checkOutImg = checkOutImg ?? this.checkOutImg
  165. ..status = status ?? this.status
  166. ..statusShow = statusShow ?? this.statusShow
  167. ..isExpended = isExpended ?? this.isExpended;
  168. }
  169. }