attendance_entity.g.dart 5.9 KB

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