fix: order

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

View File

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