attendance_entity.g.dart 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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 int? checkInId = jsonConvert.convert<int>(json['check_in_id']);
  59. if (checkInId != null) {
  60. attendanceList.checkInId = checkInId;
  61. }
  62. final String? checkInTime = jsonConvert.convert<String>(json['check_in_time']);
  63. if (checkInTime != null) {
  64. attendanceList.checkInTime = checkInTime;
  65. }
  66. final String? checkInImg = jsonConvert.convert<String>(json['check_in_img']);
  67. if (checkInImg != null) {
  68. attendanceList.checkInImg = checkInImg;
  69. }
  70. final int? checkOutId = jsonConvert.convert<int>(json['check_out_id']);
  71. if (checkOutId != null) {
  72. attendanceList.checkOutId = checkOutId;
  73. }
  74. final String? checkOutTime = jsonConvert.convert<String>(json['check_out_time']);
  75. if (checkOutTime != null) {
  76. attendanceList.checkOutTime = checkOutTime;
  77. }
  78. final String? checkOutImg = jsonConvert.convert<String>(json['check_out_img']);
  79. if (checkOutImg != null) {
  80. attendanceList.checkOutImg = checkOutImg;
  81. }
  82. final int? status = jsonConvert.convert<int>(json['status']);
  83. if (status != null) {
  84. attendanceList.status = status;
  85. }
  86. final String? statusShow = jsonConvert.convert<String>(json['status_show']);
  87. if (statusShow != null) {
  88. attendanceList.statusShow = statusShow;
  89. }
  90. final bool? isExpended = jsonConvert.convert<bool>(json['isExpended']);
  91. if (isExpended != null) {
  92. attendanceList.isExpended = isExpended;
  93. }
  94. return attendanceList;
  95. }
  96. Map<String, dynamic> $AttendanceListToJson(AttendanceList entity) {
  97. final Map<String, dynamic> data = <String, dynamic>{};
  98. data['applied_id'] = entity.appliedId;
  99. data['staff_id'] = entity.staffId;
  100. data['staff_name'] = entity.staffName;
  101. data['job_date'] = entity.jobDate;
  102. data['start_time'] = entity.startTime;
  103. data['end_time'] = entity.endTime;
  104. data['check_in_id'] = entity.checkInId;
  105. data['check_in_time'] = entity.checkInTime;
  106. data['check_in_img'] = entity.checkInImg;
  107. data['check_out_id'] = entity.checkOutId;
  108. data['check_out_time'] = entity.checkOutTime;
  109. data['check_out_img'] = entity.checkOutImg;
  110. data['status'] = entity.status;
  111. data['status_show'] = entity.statusShow;
  112. data['isExpended'] = entity.isExpended;
  113. return data;
  114. }
  115. extension AttendanceListExtension on AttendanceList {
  116. AttendanceList copyWith({
  117. int? appliedId,
  118. int? staffId,
  119. String? staffName,
  120. String? jobDate,
  121. String? startTime,
  122. String? endTime,
  123. int? checkInId,
  124. String? checkInTime,
  125. String? checkInImg,
  126. int? checkOutId,
  127. String? checkOutTime,
  128. String? checkOutImg,
  129. int? status,
  130. String? statusShow,
  131. bool? isExpended,
  132. }) {
  133. return AttendanceList()
  134. ..appliedId = appliedId ?? this.appliedId
  135. ..staffId = staffId ?? this.staffId
  136. ..staffName = staffName ?? this.staffName
  137. ..jobDate = jobDate ?? this.jobDate
  138. ..startTime = startTime ?? this.startTime
  139. ..endTime = endTime ?? this.endTime
  140. ..checkInId = checkInId ?? this.checkInId
  141. ..checkInTime = checkInTime ?? this.checkInTime
  142. ..checkInImg = checkInImg ?? this.checkInImg
  143. ..checkOutId = checkOutId ?? this.checkOutId
  144. ..checkOutTime = checkOutTime ?? this.checkOutTime
  145. ..checkOutImg = checkOutImg ?? this.checkOutImg
  146. ..status = status ?? this.status
  147. ..statusShow = statusShow ?? this.statusShow
  148. ..isExpended = isExpended ?? this.isExpended;
  149. }
  150. }