uk_attendance_review_entity.g.dart 6.7 KB

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