update cart

This commit is contained in:
Phuoc Nguyen
2025-11-14 16:19:25 +07:00
parent 4738553d2e
commit aae3c9d080
30 changed files with 5954 additions and 758 deletions

View File

@@ -169,6 +169,25 @@ class ApiConstants {
/// GET /categories/{categoryId}/products
static const String getProductsByCategory = '/categories';
// ============================================================================
// Cart Endpoints (Frappe ERPNext)
// ============================================================================
/// Add items to cart
/// POST /api/method/building_material.building_material.api.user_cart.add_to_cart
/// Body: { "items": [{ "item_id": "...", "amount": 0, "quantity": 0 }] }
static const String addToCart = '/building_material.building_material.api.user_cart.add_to_cart';
/// Remove items from cart
/// POST /api/method/building_material.building_material.api.user_cart.remove_from_cart
/// Body: { "item_ids": ["item_id1", "item_id2"] }
static const String removeFromCart = '/building_material.building_material.api.user_cart.remove_from_cart';
/// Get user's cart items
/// POST /api/method/building_material.building_material.api.user_cart.get_user_cart
/// Body: { "limit_start": 0, "limit_page_length": 0 }
static const String getUserCart = '/building_material.building_material.api.user_cart.get_user_cart';
// ============================================================================
// Order Endpoints
// ============================================================================