attendance_review_entity.g.dart 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/response/attendance_review_entity.dart';
  3. AttendanceReviewEntity $AttendanceReviewEntityFromJson(
  4. Map<String, dynamic> json) {
  5. final AttendanceReviewEntity attendanceReviewEntity = AttendanceReviewEntity();
  6. final int? total = jsonConvert.convert<int>(json['total']);
  7. if (total != null) {
  8. attendanceReviewEntity.total = total;
  9. }
  10. final List<AttendanceReviewRows>? rows = (json['rows'] as List<dynamic>?)
  11. ?.map(
  12. (e) =>
  13. jsonConvert.convert<AttendanceReviewRows>(e) as AttendanceReviewRows)
  14. .toList();
  15. if (rows != null) {
  16. attendanceReviewEntity.rows = rows;
  17. }
  18. return attendanceReviewEntity;
  19. }
  20. Map<String, dynamic> $AttendanceReviewEntityToJson(
  21. AttendanceReviewEntity entity) {
  22. final Map<String, dynamic> data = <String, dynamic>{};
  23. data['total'] = entity.total;
  24. data['rows'] = entity.rows.map((v) => v.toJson()).toList();
  25. return data;
  26. }
  27. extension AttendanceReviewEntityExtension on AttendanceReviewEntity {
  28. AttendanceReviewEntity copyWith({
  29. int? total,
  30. List<AttendanceReviewRows>? rows,
  31. }) {
  32. return AttendanceReviewEntity()
  33. ..total = total ?? this.total
  34. ..rows = rows ?? this.rows;
  35. }
  36. }
  37. AttendanceReviewRows $AttendanceReviewRowsFromJson(Map<String, dynamic> json) {
  38. final AttendanceReviewRows attendanceReviewRows = AttendanceReviewRows();
  39. final String? recordId = jsonConvert.convert<String>(json['record_id']);
  40. if (recordId != null) {
  41. attendanceReviewRows.recordId = recordId;
  42. }
  43. final String? orderId = jsonConvert.convert<String>(json['order_id']);
  44. if (orderId != null) {
  45. attendanceReviewRows.orderId = orderId;
  46. }
  47. final String? appliedId = jsonConvert.convert<String>(json['applied_id']);
  48. if (appliedId != null) {
  49. attendanceReviewRows.appliedId = appliedId;
  50. }
  51. final String? staffName = jsonConvert.convert<String>(json['staff_name']);
  52. if (staffName != null) {
  53. attendanceReviewRows.staffName = staffName;
  54. }
  55. final String? jobTitle = jsonConvert.convert<String>(json['job_title']);
  56. if (jobTitle != null) {
  57. attendanceReviewRows.jobTitle = jobTitle;
  58. }
  59. final String? departmentName = jsonConvert.convert<String>(
  60. json['department_name']);
  61. if (departmentName != null) {
  62. attendanceReviewRows.departmentName = departmentName;
  63. }
  64. final String? jobTime = jsonConvert.convert<String>(json['job_time']);
  65. if (jobTime != null) {
  66. attendanceReviewRows.jobTime = jobTime;
  67. }
  68. final String? statusShow = jsonConvert.convert<String>(json['status_show']);
  69. if (statusShow != null) {
  70. attendanceReviewRows.statusShow = statusShow;
  71. }
  72. final String? adjustShow = jsonConvert.convert<String>(json['adjust_show']);
  73. if (adjustShow != null) {
  74. attendanceReviewRows.adjustShow = adjustShow;
  75. }
  76. final String? totalShow = jsonConvert.convert<String>(json['total_show']);
  77. if (totalShow != null) {
  78. attendanceReviewRows.totalShow = totalShow;
  79. }
  80. final String? clockIn = jsonConvert.convert<String>(json['clock_in']);
  81. if (clockIn != null) {
  82. attendanceReviewRows.clockIn = clockIn;
  83. }
  84. final int? inClass = jsonConvert.convert<int>(json['in_class']);
  85. if (inClass != null) {
  86. attendanceReviewRows.inClass = inClass;
  87. }
  88. final String? clockOut = jsonConvert.convert<String>(json['clock_out']);
  89. if (clockOut != null) {
  90. attendanceReviewRows.clockOut = clockOut;
  91. }
  92. final int? outClass = jsonConvert.convert<int>(json['out_class']);
  93. if (outClass != null) {
  94. attendanceReviewRows.outClass = outClass;
  95. }
  96. final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  97. if (createdAt != null) {
  98. attendanceReviewRows.createdAt = createdAt;
  99. }
  100. final int? hasReason = jsonConvert.convert<int>(json['has_reason']);
  101. if (hasReason != null) {
  102. attendanceReviewRows.hasReason = hasReason;
  103. }
  104. final bool? isSelected = jsonConvert.convert<bool>(json['isSelected']);
  105. if (isSelected != null) {
  106. attendanceReviewRows.isSelected = isSelected;
  107. }
  108. return attendanceReviewRows;
  109. }
  110. Map<String, dynamic> $AttendanceReviewRowsToJson(AttendanceReviewRows entity) {
  111. final Map<String, dynamic> data = <String, dynamic>{};
  112. data['record_id'] = entity.recordId;
  113. data['order_id'] = entity.orderId;
  114. data['applied_id'] = entity.appliedId;
  115. data['staff_name'] = entity.staffName;
  116. data['job_title'] = entity.jobTitle;
  117. data['department_name'] = entity.departmentName;
  118. data['job_time'] = entity.jobTime;
  119. data['status_show'] = entity.statusShow;
  120. data['adjust_show'] = entity.adjustShow;
  121. data['total_show'] = entity.totalShow;
  122. data['clock_in'] = entity.clockIn;
  123. data['in_class'] = entity.inClass;
  124. data['clock_out'] = entity.clockOut;
  125. data['out_class'] = entity.outClass;
  126. data['created_at'] = entity.createdAt;
  127. data['has_reason'] = entity.hasReason;
  128. data['isSelected'] = entity.isSelected;
  129. return data;
  130. }
  131. extension AttendanceReviewRowsExtension on AttendanceReviewRows {
  132. AttendanceReviewRows copyWith({
  133. String? recordId,
  134. String? orderId,
  135. String? appliedId,
  136. String? staffName,
  137. String? jobTitle,
  138. String? departmentName,
  139. String? jobTime,
  140. String? statusShow,
  141. String? adjustShow,
  142. String? totalShow,
  143. String? clockIn,
  144. int? inClass,
  145. String? clockOut,
  146. int? outClass,
  147. String? createdAt,
  148. int? hasReason,
  149. bool? isSelected,
  150. }) {
  151. return AttendanceReviewRows()
  152. ..recordId = recordId ?? this.recordId
  153. ..orderId = orderId ?? this.orderId
  154. ..appliedId = appliedId ?? this.appliedId
  155. ..staffName = staffName ?? this.staffName
  156. ..jobTitle = jobTitle ?? this.jobTitle
  157. ..departmentName = departmentName ?? this.departmentName
  158. ..jobTime = jobTime ?? this.jobTime
  159. ..statusShow = statusShow ?? this.statusShow
  160. ..adjustShow = adjustShow ?? this.adjustShow
  161. ..totalShow = totalShow ?? this.totalShow
  162. ..clockIn = clockIn ?? this.clockIn
  163. ..inClass = inClass ?? this.inClass
  164. ..clockOut = clockOut ?? this.clockOut
  165. ..outClass = outClass ?? this.outClass
  166. ..createdAt = createdAt ?? this.createdAt
  167. ..hasReason = hasReason ?? this.hasReason
  168. ..isSelected = isSelected ?? this.isSelected;
  169. }
  170. }