garage_sale_history_entity.dart 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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/garage_sale_history_entity.g.dart';
  4. import 'dart:convert';
  5. export 'package:domain/generated/json/garage_sale_history_entity.g.dart';
  6. @JsonSerializable()
  7. class GarageSaleHistoryEntity {
  8. int count = 0;
  9. int page = 0;
  10. int limit = 0;
  11. @JSONField(name: "count_page")
  12. int countPage = 0;
  13. List<GarageSaleHistoryList> list = [];
  14. GarageSaleHistoryEntity();
  15. factory GarageSaleHistoryEntity.fromJson(Map<String, dynamic> json) => $GarageSaleHistoryEntityFromJson(json);
  16. Map<String, dynamic> toJson() => $GarageSaleHistoryEntityToJson(this);
  17. @override
  18. String toString() {
  19. return jsonEncode(this);
  20. }
  21. }
  22. @JsonSerializable()
  23. class GarageSaleHistoryList {
  24. String? id;
  25. String? sn;
  26. @JSONField(name: "order_status")
  27. String? orderStatus;
  28. @JSONField(name: "created_at")
  29. String? createdAt;
  30. IdNameEntity? service;
  31. IdNameEntity? merchant;
  32. @JSONField(name: "order_products")
  33. List<GarageSaleHistoryListOrderProducts> orderProducts = [];
  34. GarageSaleHistoryList();
  35. factory GarageSaleHistoryList.fromJson(Map<String, dynamic> json) => $GarageSaleHistoryListFromJson(json);
  36. Map<String, dynamic> toJson() => $GarageSaleHistoryListToJson(this);
  37. @override
  38. String toString() {
  39. return jsonEncode(this);
  40. }
  41. }
  42. @JsonSerializable()
  43. class GarageSaleHistoryListOrderProducts {
  44. String? id;
  45. @JSONField(name: "product_name")
  46. String? productName;
  47. int quantity = 0;
  48. @JSONField(name: "total_amount")
  49. String? totalAmount;
  50. @JSONField(name: "planned_service_at")
  51. String? plannedServiceAt;
  52. GarageSaleHistoryListOrderProducts();
  53. factory GarageSaleHistoryListOrderProducts.fromJson(Map<String, dynamic> json) => $GarageSaleHistoryListOrderProductsFromJson(json);
  54. Map<String, dynamic> toJson() => $GarageSaleHistoryListOrderProductsToJson(this);
  55. @override
  56. String toString() {
  57. return jsonEncode(this);
  58. }
  59. }