service_in_progress_entity.g.dart 6.9 KB

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