import 'package:domain/entity/id_name_entity.dart'; import 'package:domain/generated/json/base/json_field.dart'; import 'package:domain/generated/json/service_order_detail_entity.g.dart'; import 'dart:convert'; export 'package:domain/generated/json/service_order_detail_entity.g.dart'; @JsonSerializable() class ServiceOrderDetailEntity { String? id; String? sn; @JSONField(name: "total_amount") String? totalAmount; @JSONField(name: "paid_at") String? paidAt; String? notes; ServiceOrderDetailAccount? account; @JSONField(name: "order_service") ServiceOrderDetailOrderService? orderService; IdNameEntity? merchant; @JSONField(name: "order_products") List? orderProducts = []; ServiceOrderDetailEstate? estate; @JSONField(name: "estate_unit") ServiceOrderDetailEstateUnit? estateUnit; ServiceOrderDetailEntity(); factory ServiceOrderDetailEntity.fromJson(Map json) => $ServiceOrderDetailEntityFromJson(json); Map toJson() => $ServiceOrderDetailEntityToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class ServiceOrderDetailAccount { String? id; String? name; String? avatar; String? phone; ServiceOrderDetailAccount(); factory ServiceOrderDetailAccount.fromJson(Map json) => $ServiceOrderDetailAccountFromJson(json); Map toJson() => $ServiceOrderDetailAccountToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class ServiceOrderDetailOrderService { String? id; String? name; @JSONField(name: "evaluations_avg_score") double evaluationsAvgScore = 0.0; ServiceOrderDetailOrderService(); factory ServiceOrderDetailOrderService.fromJson(Map json) => $ServiceOrderDetailOrderServiceFromJson(json); Map toJson() => $ServiceOrderDetailOrderServiceToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class ServiceOrderDetailOrderProducts { String? id; @JSONField(name: "product_name") String? productName; @JSONField(name: "product_amount") String? productAmount; @JSONField(name: "urgent_amount") String? urgentAmount; @JSONField(name: "holiday_amount") String? holidayAmount; @JSONField(name: "night_amount") String? nightAmount; int quantity = 0; @JSONField(name: "total_amount") String? totalAmount; @JSONField(name: "planned_service_at") String? plannedServiceAt; ServiceOrderDetailOrderProducts(); factory ServiceOrderDetailOrderProducts.fromJson(Map json) => $ServiceOrderDetailOrderProductsFromJson(json); Map toJson() => $ServiceOrderDetailOrderProductsToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class ServiceOrderDetailEstate { String? id; String? name; ServiceOrderDetailEstate(); factory ServiceOrderDetailEstate.fromJson(Map json) => $ServiceOrderDetailEstateFromJson(json); Map toJson() => $ServiceOrderDetailEstateToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class ServiceOrderDetailEstateUnit { String? id; String? unit; String? address; ServiceOrderDetailEstateUnit(); factory ServiceOrderDetailEstateUnit.fromJson(Map json) => $ServiceOrderDetailEstateUnitFromJson(json); Map toJson() => $ServiceOrderDetailEstateUnitToJson(this); @override String toString() { return jsonEncode(this); } }