fix: order
This commit is contained in:
parent
f0ff078e0e
commit
d7cd6ce4f2
@ -41,18 +41,25 @@ class OrderRequestModel {
|
|||||||
customerName: json["customer_name"],
|
customerName: json["customer_name"],
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toMap() => {
|
Map<String, dynamic> toMap() {
|
||||||
"outlet_id": outletId,
|
Map<String, dynamic> data = {
|
||||||
"customer_id": customerId,
|
"outlet_id": outletId,
|
||||||
"table_number": tableNumber,
|
"table_number": tableNumber,
|
||||||
"table_id": tableId,
|
"table_id": tableId,
|
||||||
"order_type": orderType,
|
"order_type": orderType,
|
||||||
"notes": notes,
|
"notes": notes,
|
||||||
"order_items": orderItems == null
|
"order_items": orderItems == null
|
||||||
? []
|
? []
|
||||||
: 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 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user