fix: ui refund and sales page

This commit is contained in:
efrilm
2025-08-07 20:11:57 +07:00
parent e3da008a9a
commit 49fef5afb2
3 changed files with 75 additions and 66 deletions
@@ -113,6 +113,7 @@ class Order {
final DateTime? createdAt;
final DateTime? updatedAt;
final List<OrderItem>? orderItems;
final bool? isRefund;
Order({
this.id,
@@ -131,6 +132,7 @@ class Order {
this.createdAt,
this.updatedAt,
this.orderItems,
this.isRefund,
});
factory Order.fromMap(Map<String, dynamic> json) => Order(
@@ -147,6 +149,7 @@ class Order {
totalAmount: json["total_amount"],
notes: json["notes"],
metadata: json["metadata"] ?? {},
isRefund: json["is_refund"],
createdAt: json["created_at"] == null
? null
: DateTime.parse(json["created_at"]),
@@ -175,6 +178,7 @@ class Order {
"metadata": metadata,
"created_at": createdAt?.toIso8601String(),
"updated_at": updatedAt?.toIso8601String(),
"is_refund": isRefund,
"order_items": orderItems == null
? []
: List<dynamic>.from(orderItems!.map((x) => x.toMap())),