fix: order

This commit is contained in:
efrilm 2025-08-05 22:39:43 +07:00
parent f0ff078e0e
commit d7cd6ce4f2

View File

@ -41,18 +41,25 @@ class OrderRequestModel {
customerName: json["customer_name"],
);
Map<String, dynamic> toMap() => {
"outlet_id": outletId,
"customer_id": customerId,
"table_number": tableNumber,
"table_id": tableId,
"order_type": orderType,
"notes": notes,
"order_items": orderItems == null
? []
: List<dynamic>.from(orderItems!.map((x) => x.toMap())),
"customer_name": customerName,
};
Map<String, dynamic> toMap() {
Map<String, dynamic> data = {
"outlet_id": outletId,
"table_number": tableNumber,
"table_id": tableId,
"order_type": orderType,
"notes": notes,
"order_items": orderItems == null
? []
: List<dynamic>.from(orderItems!.map((x) => x.toMap())),
"customer_name": customerName,
};
if (customerId != null || customerId != "") {
data["customer_id"] = customerId;
}
return data;
}
}
class OrderItemRequest {