service_in_progress_entity.g.dart 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/service_in_progress_entity.dart';
  3. ServiceInProgressEntity $ServiceInProgressEntityFromJson(
  4. Map<String, dynamic> json) {
  5. final ServiceInProgressEntity serviceInProgressEntity = ServiceInProgressEntity();
  6. final int? count = jsonConvert.convert<int>(json['count']);
  7. if (count != null) {
  8. serviceInProgressEntity.count = count;
  9. }
  10. final int? page = jsonConvert.convert<int>(json['page']);
  11. if (page != null) {
  12. serviceInProgressEntity.page = page;
  13. }
  14. final int? limit = jsonConvert.convert<int>(json['limit']);
  15. if (limit != null) {
  16. serviceInProgressEntity.limit = limit;
  17. }
  18. final int? countPage = jsonConvert.convert<int>(json['count_page']);
  19. if (countPage != null) {
  20. serviceInProgressEntity.countPage = countPage;
  21. }
  22. final List<ServiceInProgressList>? list = (json['list'] as List<dynamic>?)
  23. ?.map(
  24. (e) =>
  25. jsonConvert.convert<ServiceInProgressList>(e) as ServiceInProgressList)
  26. .toList();
  27. if (list != null) {
  28. serviceInProgressEntity.list = list;
  29. }
  30. return serviceInProgressEntity;
  31. }
  32. Map<String, dynamic> $ServiceInProgressEntityToJson(
  33. ServiceInProgressEntity entity) {
  34. final Map<String, dynamic> data = <String, dynamic>{};
  35. data['count'] = entity.count;
  36. data['page'] = entity.page;
  37. data['limit'] = entity.limit;
  38. data['count_page'] = entity.countPage;
  39. data['list'] = entity.list.map((v) => v.toJson()).toList();
  40. return data;
  41. }
  42. extension ServiceInProgressEntityExtension on ServiceInProgressEntity {
  43. ServiceInProgressEntity copyWith({
  44. int? count,
  45. int? page,
  46. int? limit,
  47. int? countPage,
  48. List<ServiceInProgressList>? list,
  49. }) {
  50. return ServiceInProgressEntity()
  51. ..count = count ?? this.count
  52. ..page = page ?? this.page
  53. ..limit = limit ?? this.limit
  54. ..countPage = countPage ?? this.countPage
  55. ..list = list ?? this.list;
  56. }
  57. }
  58. ServiceInProgressList $ServiceInProgressListFromJson(
  59. Map<String, dynamic> json) {
  60. final ServiceInProgressList serviceInProgressList = ServiceInProgressList();
  61. final int? id = jsonConvert.convert<int>(json['id']);
  62. if (id != null) {
  63. serviceInProgressList.id = id;
  64. }
  65. final String? sn = jsonConvert.convert<String>(json['sn']);
  66. if (sn != null) {
  67. serviceInProgressList.sn = sn;
  68. }
  69. final String? userNotes = jsonConvert.convert<String>(json['user_notes']);
  70. if (userNotes != null) {
  71. serviceInProgressList.userNotes = userNotes;
  72. }
  73. final String? merchantNotes = jsonConvert.convert<String>(
  74. json['merchant_notes']);
  75. if (merchantNotes != null) {
  76. serviceInProgressList.merchantNotes = merchantNotes;
  77. }
  78. final String? orderStatus = jsonConvert.convert<String>(json['order_status']);
  79. if (orderStatus != null) {
  80. serviceInProgressList.orderStatus = orderStatus;
  81. }
  82. final ServiceInProgressListService? service = jsonConvert.convert<
  83. ServiceInProgressListService>(json['service']);
  84. if (service != null) {
  85. serviceInProgressList.service = service;
  86. }
  87. final ServiceInProgressListMerchant? merchant = jsonConvert.convert<
  88. ServiceInProgressListMerchant>(json['merchant']);
  89. if (merchant != null) {
  90. serviceInProgressList.merchant = merchant;
  91. }
  92. final String? staff = jsonConvert.convert<String>(json['staff']);
  93. if (staff != null) {
  94. serviceInProgressList.staff = staff;
  95. }
  96. return serviceInProgressList;
  97. }
  98. Map<String, dynamic> $ServiceInProgressListToJson(
  99. ServiceInProgressList entity) {
  100. final Map<String, dynamic> data = <String, dynamic>{};
  101. data['id'] = entity.id;
  102. data['sn'] = entity.sn;
  103. data['user_notes'] = entity.userNotes;
  104. data['merchant_notes'] = entity.merchantNotes;
  105. data['order_status'] = entity.orderStatus;
  106. data['service'] = entity.service.toJson();
  107. data['merchant'] = entity.merchant.toJson();
  108. data['staff'] = entity.staff;
  109. return data;
  110. }
  111. extension ServiceInProgressListExtension on ServiceInProgressList {
  112. ServiceInProgressList copyWith({
  113. int? id,
  114. String? sn,
  115. String? userNotes,
  116. String? merchantNotes,
  117. String? orderStatus,
  118. ServiceInProgressListService? service,
  119. ServiceInProgressListMerchant? merchant,
  120. String? staff,
  121. }) {
  122. return ServiceInProgressList()
  123. ..id = id ?? this.id
  124. ..sn = sn ?? this.sn
  125. ..userNotes = userNotes ?? this.userNotes
  126. ..merchantNotes = merchantNotes ?? this.merchantNotes
  127. ..orderStatus = orderStatus ?? this.orderStatus
  128. ..service = service ?? this.service
  129. ..merchant = merchant ?? this.merchant
  130. ..staff = staff ?? this.staff;
  131. }
  132. }
  133. ServiceInProgressListService $ServiceInProgressListServiceFromJson(
  134. Map<String, dynamic> json) {
  135. final ServiceInProgressListService serviceInProgressListService = ServiceInProgressListService();
  136. final int? id = jsonConvert.convert<int>(json['id']);
  137. if (id != null) {
  138. serviceInProgressListService.id = id;
  139. }
  140. final String? name = jsonConvert.convert<String>(json['name']);
  141. if (name != null) {
  142. serviceInProgressListService.name = name;
  143. }
  144. return serviceInProgressListService;
  145. }
  146. Map<String, dynamic> $ServiceInProgressListServiceToJson(
  147. ServiceInProgressListService entity) {
  148. final Map<String, dynamic> data = <String, dynamic>{};
  149. data['id'] = entity.id;
  150. data['name'] = entity.name;
  151. return data;
  152. }
  153. extension ServiceInProgressListServiceExtension on ServiceInProgressListService {
  154. ServiceInProgressListService copyWith({
  155. int? id,
  156. String? name,
  157. }) {
  158. return ServiceInProgressListService()
  159. ..id = id ?? this.id
  160. ..name = name ?? this.name;
  161. }
  162. }
  163. ServiceInProgressListMerchant $ServiceInProgressListMerchantFromJson(
  164. Map<String, dynamic> json) {
  165. final ServiceInProgressListMerchant serviceInProgressListMerchant = ServiceInProgressListMerchant();
  166. final int? id = jsonConvert.convert<int>(json['id']);
  167. if (id != null) {
  168. serviceInProgressListMerchant.id = id;
  169. }
  170. final String? name = jsonConvert.convert<String>(json['name']);
  171. if (name != null) {
  172. serviceInProgressListMerchant.name = name;
  173. }
  174. final String? contactPhone = jsonConvert.convert<String>(
  175. json['contact_phone']);
  176. if (contactPhone != null) {
  177. serviceInProgressListMerchant.contactPhone = contactPhone;
  178. }
  179. return serviceInProgressListMerchant;
  180. }
  181. Map<String, dynamic> $ServiceInProgressListMerchantToJson(
  182. ServiceInProgressListMerchant entity) {
  183. final Map<String, dynamic> data = <String, dynamic>{};
  184. data['id'] = entity.id;
  185. data['name'] = entity.name;
  186. data['contact_phone'] = entity.contactPhone;
  187. return data;
  188. }
  189. extension ServiceInProgressListMerchantExtension on ServiceInProgressListMerchant {
  190. ServiceInProgressListMerchant copyWith({
  191. int? id,
  192. String? name,
  193. String? contactPhone,
  194. }) {
  195. return ServiceInProgressListMerchant()
  196. ..id = id ?? this.id
  197. ..name = name ?? this.name
  198. ..contactPhone = contactPhone ?? this.contactPhone;
  199. }
  200. }