order success

This commit is contained in:
Phuoc Nguyen
2025-11-24 17:28:17 +07:00
parent 1851d60038
commit c3b5653420
9 changed files with 55 additions and 34 deletions

View File

@@ -92,6 +92,8 @@ class OrderRemoteDataSource {
/// "customer_address": "...",
/// "description": "...",
/// "payment_terms": "...",
/// "ignore_pricing_rule": true,
/// "contract_request": true,
/// "items": [{"item_id": "...", "qty_entered": 0, "primary_qty": 0, "price_entered": 0}]
/// }
/// Returns: { "message": { "name": "SAL-ORD-2025-00001", ... } }
@@ -100,7 +102,8 @@ class OrderRemoteDataSource {
required Map<String, dynamic> deliveryAddress,
required String paymentMethod,
bool needsInvoice = false,
bool needsNegotiation = false,
bool ignorePricingRule = false,
bool contractRequest = false,
String? notes,
}) async {
try {
@@ -126,6 +129,8 @@ class OrderRemoteDataSource {
'customer_address': deliveryAddress['name'] ?? '',
'description': notes ?? 'Order from mobile app',
'payment_terms': paymentMethod,
'ignore_pricing_rule': ignorePricingRule,
'contract_request': contractRequest,
'items': formattedItems,
};

View File

@@ -98,7 +98,8 @@ class OrderRepositoryImpl implements OrderRepository {
required Map<String, dynamic> deliveryAddress,
required String paymentMethod,
bool needsInvoice = false,
bool needsNegotiation = false,
bool ignorePricingRule = false,
bool contractRequest = false,
String? notes,
}) async {
try {
@@ -107,7 +108,8 @@ class OrderRepositoryImpl implements OrderRepository {
deliveryAddress: deliveryAddress,
paymentMethod: paymentMethod,
needsInvoice: needsInvoice,
needsNegotiation: needsNegotiation,
ignorePricingRule: ignorePricingRule,
contractRequest: contractRequest,
notes: notes,
);
} catch (e) {