service_order_detail_entity.dart 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. import 'package:domain/entity/id_name_entity.dart';
  2. import 'package:domain/generated/json/base/json_field.dart';
  3. import 'package:domain/generated/json/service_order_detail_entity.g.dart';
  4. import 'dart:convert';
  5. export 'package:domain/generated/json/service_order_detail_entity.g.dart';
  6. @JsonSerializable()
  7. class ServiceOrderDetailEntity {
  8. String? id;
  9. String? sn;
  10. @JSONField(name: "total_amount")
  11. String? totalAmount;
  12. @JSONField(name: "paid_at")
  13. String? paidAt;
  14. String? notes;
  15. ServiceOrderDetailAccount? account;
  16. @JSONField(name: "order_service")
  17. ServiceOrderDetailOrderService? orderService;
  18. IdNameEntity? merchant;
  19. @JSONField(name: "order_products")
  20. List<ServiceOrderDetailOrderProducts>? orderProducts = [];
  21. ServiceOrderDetailEstate? estate;
  22. @JSONField(name: "estate_unit")
  23. ServiceOrderDetailEstateUnit? estateUnit;
  24. ServiceOrderDetailEntity();
  25. factory ServiceOrderDetailEntity.fromJson(Map<String, dynamic> json) => $ServiceOrderDetailEntityFromJson(json);
  26. Map<String, dynamic> toJson() => $ServiceOrderDetailEntityToJson(this);
  27. @override
  28. String toString() {
  29. return jsonEncode(this);
  30. }
  31. }
  32. @JsonSerializable()
  33. class ServiceOrderDetailAccount {
  34. String? id;
  35. String? name;
  36. String? avatar;
  37. String? phone;
  38. ServiceOrderDetailAccount();
  39. factory ServiceOrderDetailAccount.fromJson(Map<String, dynamic> json) => $ServiceOrderDetailAccountFromJson(json);
  40. Map<String, dynamic> toJson() => $ServiceOrderDetailAccountToJson(this);
  41. @override
  42. String toString() {
  43. return jsonEncode(this);
  44. }
  45. }
  46. @JsonSerializable()
  47. class ServiceOrderDetailOrderService {
  48. String? id;
  49. String? name;
  50. @JSONField(name: "evaluations_avg_score")
  51. double evaluationsAvgScore = 0.0;
  52. ServiceOrderDetailOrderService();
  53. factory ServiceOrderDetailOrderService.fromJson(Map<String, dynamic> json) => $ServiceOrderDetailOrderServiceFromJson(json);
  54. Map<String, dynamic> toJson() => $ServiceOrderDetailOrderServiceToJson(this);
  55. @override
  56. String toString() {
  57. return jsonEncode(this);
  58. }
  59. }
  60. @JsonSerializable()
  61. class ServiceOrderDetailOrderProducts {
  62. String? id;
  63. @JSONField(name: "product_name")
  64. String? productName;
  65. @JSONField(name: "product_amount")
  66. String? productAmount;
  67. @JSONField(name: "urgent_amount")
  68. String? urgentAmount;
  69. @JSONField(name: "holiday_amount")
  70. String? holidayAmount;
  71. @JSONField(name: "night_amount")
  72. String? nightAmount;
  73. int quantity = 0;
  74. @JSONField(name: "total_amount")
  75. String? totalAmount;
  76. @JSONField(name: "planned_service_at")
  77. String? plannedServiceAt;
  78. ServiceOrderDetailOrderProducts();
  79. factory ServiceOrderDetailOrderProducts.fromJson(Map<String, dynamic> json) => $ServiceOrderDetailOrderProductsFromJson(json);
  80. Map<String, dynamic> toJson() => $ServiceOrderDetailOrderProductsToJson(this);
  81. @override
  82. String toString() {
  83. return jsonEncode(this);
  84. }
  85. }
  86. @JsonSerializable()
  87. class ServiceOrderDetailEstate {
  88. String? id;
  89. String? name;
  90. ServiceOrderDetailEstate();
  91. factory ServiceOrderDetailEstate.fromJson(Map<String, dynamic> json) => $ServiceOrderDetailEstateFromJson(json);
  92. Map<String, dynamic> toJson() => $ServiceOrderDetailEstateToJson(this);
  93. @override
  94. String toString() {
  95. return jsonEncode(this);
  96. }
  97. }
  98. @JsonSerializable()
  99. class ServiceOrderDetailEstateUnit {
  100. String? id;
  101. String? unit;
  102. String? address;
  103. ServiceOrderDetailEstateUnit();
  104. factory ServiceOrderDetailEstateUnit.fromJson(Map<String, dynamic> json) => $ServiceOrderDetailEstateUnitFromJson(json);
  105. Map<String, dynamic> toJson() => $ServiceOrderDetailEstateUnitToJson(this);
  106. @override
  107. String toString() {
  108. return jsonEncode(this);
  109. }
  110. }