- Backend: FastAPI app with all models, services, schemas, routes - Admin Panel: Next.js dashboard with all modules (CRM, POS, repairs, warranties, billing, notifications, etc.) - Ecommerce: storefront (submodule) + product catalog - AI Agents: .agents/ skill library for Antigravity IDE - Docs: architecture, billing, notification gateway markdown - Submodules: Backend/OpenWA, Ecommerce/File 2/storefront
27 lines
674 B
Markdown
27 lines
674 B
Markdown
# Shopping Cart Architecture
|
|
|
|
## Guest & Customer Session Management
|
|
|
|
Managed via `CartRouter.py`. Frontend client prices are **NEVER trusted**.
|
|
|
|
---
|
|
|
|
## Storage Model
|
|
|
|
* **Guest Carts**: Saved in Redis (`cart:visitor:{visitor_id}`) with 7-day TTL.
|
|
* **Customer Carts**: Persisted in MySQL (`carts` table with JSON items) and cached in Redis (`cart:customer:{customer_id}`).
|
|
|
|
---
|
|
|
|
## Price Recalculation Engine
|
|
|
|
Every read or item addition forces server-side recalculation:
|
|
|
|
```text
|
|
Unit Base Price (from MySQL ProductVariant)
|
|
- Promotional Discount / Coupon
|
|
+ Tax (CGST / SGST / IGST)
|
|
+ Shipping Charges
|
|
-------------------------------------------
|
|
= Total Final Amount
|
|
```
|