import 'package:domain/entity/id_name_entity.dart'; import 'package:domain/generated/json/base/json_field.dart'; import 'package:domain/generated/json/garage_sale_history_entity.g.dart'; import 'dart:convert'; export 'package:domain/generated/json/garage_sale_history_entity.g.dart'; @JsonSerializable() class GarageSaleHistoryEntity { int count = 0; int page = 0; int limit = 0; @JSONField(name: "count_page") int countPage = 0; List list = []; GarageSaleHistoryEntity(); factory GarageSaleHistoryEntity.fromJson(Map json) => $GarageSaleHistoryEntityFromJson(json); Map toJson() => $GarageSaleHistoryEntityToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class GarageSaleHistoryList { String? id; String? sn; @JSONField(name: "order_status") String? orderStatus; @JSONField(name: "created_at") String? createdAt; IdNameEntity? service; IdNameEntity? merchant; @JSONField(name: "order_products") List orderProducts = []; GarageSaleHistoryList(); factory GarageSaleHistoryList.fromJson(Map json) => $GarageSaleHistoryListFromJson(json); Map toJson() => $GarageSaleHistoryListToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class GarageSaleHistoryListOrderProducts { String? id; @JSONField(name: "product_name") String? productName; int quantity = 0; @JSONField(name: "total_amount") String? totalAmount; @JSONField(name: "planned_service_at") String? plannedServiceAt; GarageSaleHistoryListOrderProducts(); factory GarageSaleHistoryListOrderProducts.fromJson(Map json) => $GarageSaleHistoryListOrderProductsFromJson(json); Map toJson() => $GarageSaleHistoryListOrderProductsToJson(this); @override String toString() { return jsonEncode(this); } }