This commit is contained in:
efrilm
2025-10-31 14:33:02 +07:00
parent bf43c398d2
commit 8d9e622121
24 changed files with 3054 additions and 79 deletions
@@ -98,11 +98,18 @@ class OrderItemRequestDto with _$OrderItemRequestDto {
notes: request.notes,
);
Map<String, dynamic> toRequest() => {
"product_id": productId,
"product_variant_id": productVariantId,
"quantity": quantity,
"unit_price": unitPrice,
"notes": notes,
};
Map<String, dynamic> toRequest() {
Map<String, dynamic> data = {
"product_id": productId,
"quantity": quantity,
"unit_price": unitPrice,
"notes": notes,
};
if (productVariantId != null && productVariantId != '') {
data["product_variant_id"] = productVariantId;
}
return data;
}
}