feat: product variant
This commit is contained in:
@@ -2,7 +2,7 @@ import 'dart:convert';
|
||||
|
||||
class OrderRequestModel {
|
||||
final String? outletId;
|
||||
final String? userId;
|
||||
final String? customerId;
|
||||
final String? tableNumber;
|
||||
final String? tableId;
|
||||
final String? orderType;
|
||||
@@ -12,7 +12,7 @@ class OrderRequestModel {
|
||||
|
||||
OrderRequestModel({
|
||||
this.outletId,
|
||||
this.userId,
|
||||
this.customerId,
|
||||
this.tableNumber,
|
||||
this.tableId,
|
||||
this.orderType,
|
||||
@@ -29,7 +29,7 @@ class OrderRequestModel {
|
||||
factory OrderRequestModel.fromMap(Map<String, dynamic> json) =>
|
||||
OrderRequestModel(
|
||||
outletId: json["outlet_id"],
|
||||
userId: json["user_id"],
|
||||
customerId: json["customer_id"],
|
||||
tableNumber: json["table_number"],
|
||||
tableId: json["table_id"],
|
||||
orderType: json["order_type"],
|
||||
@@ -43,7 +43,7 @@ class OrderRequestModel {
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"outlet_id": outletId,
|
||||
"user_id": userId,
|
||||
"customer_id": customerId,
|
||||
"table_number": tableNumber,
|
||||
"table_id": tableId,
|
||||
"order_type": orderType,
|
||||
@@ -57,12 +57,14 @@ class OrderRequestModel {
|
||||
|
||||
class OrderItemRequest {
|
||||
final String? productId;
|
||||
final String? productVariantId;
|
||||
final int? quantity;
|
||||
final int? unitPrice;
|
||||
final String? notes;
|
||||
|
||||
OrderItemRequest({
|
||||
this.productId,
|
||||
this.productVariantId,
|
||||
this.quantity,
|
||||
this.unitPrice,
|
||||
this.notes,
|
||||
@@ -74,6 +76,7 @@ class OrderItemRequest {
|
||||
factory OrderItemRequest.fromMap(Map<String, dynamic> json) =>
|
||||
OrderItemRequest(
|
||||
productId: json["product_id"],
|
||||
productVariantId: json["product_variant_id"],
|
||||
quantity: json["quantity"],
|
||||
unitPrice: json["unit_price"]?.toDouble(),
|
||||
notes: json["notes"],
|
||||
@@ -81,6 +84,7 @@ class OrderItemRequest {
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"product_id": productId,
|
||||
"product_variant_id": productVariantId,
|
||||
"quantity": quantity,
|
||||
"unit_price": unitPrice,
|
||||
"notes": notes,
|
||||
|
||||
Reference in New Issue
Block a user