attendance_entity.g.dart 6.0 KB

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