ifixkart-admin/docs/adr/ADR-010-inventory-consistency.md
Adithiyan bbd3a3e959 feat: initial commit — full platform snapshot
- 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
2026-10-13 12:59:47 +05:30

8 lines
592 B
Markdown

# ADR-010: Immutable Inventory Ledger & Stock Buckets
## Context
Multi-channel selling (online storefront + physical POS counters) risks double-deduction and overselling.
## Decision
Stock balances are computed from an append-only `inventory_ledger` table using explicit transition events (`RECEIPT`, `ONLINE_RESERVE`, `ONLINE_SALE_FROM_RESERVATION`, `DIRECT_ONLINE_SALE`, `POS_ALLOCATION`, `POS_SALE_FROM_ALLOCATION`, `DIRECT_POS_SALE`, `RETURN`, `DAMAGE`). Real-time available stock follows:
$$\text{Available} = \text{Physical} - \text{Reserved} - \text{POSAllocated} - \text{Damaged}$$