- 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
21 lines
824 B
Markdown
21 lines
824 B
Markdown
# Checkout Engine Architecture
|
|
|
|
## Checkout Pipeline & Validation
|
|
|
|
Managed via `CheckoutRouter.py`. Executes strict validation before order creation.
|
|
|
|
```mermaid
|
|
flowchart TD
|
|
Req["POST /api/v1/checkout/create"] --> CartVal["1. Cart Non-Empty & Price Check"]
|
|
CartVal --> StockVal["2. Inventory Ledger Stock Check\n(Available Stock >= Qty)"]
|
|
StockVal --> AddrVal["3. Delivery Pincode & Address Validation"]
|
|
AddrVal --> TaxVal["4. Tax Engine Calculation (GST)"]
|
|
TaxVal --> ResStock["5. Create ONLINE_RESERVE Ledger Entry"]
|
|
ResStock --> CreateOrd["6. Write Order Record (ORDER_CREATED)"]
|
|
```
|
|
|
|
---
|
|
|
|
## Concurrency Protection
|
|
|
|
Stock reservation during checkout uses Redis distributed locking (`lock:variant:{variant_id}`) with a 5-second TTL to prevent double-reservation under concurrent checkout spikes.
|