25 · Inventory
Multi-domain stock, items/variations, ledger movements, vendors/POs, serials/kits, rules, and how POS sales consume inventory — including farm unit-of-measure work and remaining UI gaps.
Admin UI (/inventory/*)
| Path | Purpose |
|---|---|
/inventory | Stock overview |
/inventory/items | Items wizard / list (ItemWizardSimple unit work) |
/inventory/history · ledger | Movement history |
/inventory/stock-counts | Counts |
/inventory/purchase-orders · vendors | Procurement |
/inventory/locations | Stock locations |
/inventory/serials · kits | Serials / kits workbench |
/inventory/rules · settings | Rules & config |
/inventory/reports/* | COGS, aging, sell-through, projected profit, by category |
Catalog Manager (/admin/catalog/*) is related but menu/86/preparables oriented — sellable presentation vs stock truth.
API map
| Mount | Role |
|---|---|
/api/inventory | overview, settings, levels, receive/adjust/transfer, serials, locations, vendors, POs, … |
/api/inventory/items | Item CRUD |
/api/inventory/domains | Multi-domain (retail/food/etc.), templates, clone |
/api/inventory/ledger | Ledger entries, reverse, types |
/api/inventory/rules | Global/item/bulk rules |
/api/inventory-management | Alternate management overview/adjust/alerts/valuation |
All gated with session + tenant + checkFeatureAccess('inventory') (except platform catalog lookup).
Ledger mindset
Movements types include RECEIVE, ADJUST, TRANSFER, BREAK_CASE, KIT_BUILD_IN/OUT, and sale consumption paths from POS/recipes.
flowchart LR
PO[Purchase / receive]
ADJ[Adjust / count]
SALE[POS finalize]
REC[Recipe consumption]
LED[(Inventory ledger / levels)]
PO --> LED
ADJ --> LED
SALE --> LED
REC --> LED
POS & catalog links
- Sale finalize can deduct stock / fire recipe consumption
- Barcode scan →
/api/platform-catalog/lookupenriches item create (Master catalog) - Menus/catalog assignments feed POS & storefront product lists
- Domains + units support farm (dozen, jar) via unitOfMeasure / priceMode work
Known gaps (audit-aligned)
| Gap | Notes |
|---|---|
isConsumable UI | Backend/KDS routing flag; little/no admin toggle |
weightPerUnit / volumePerUnit | Documented schema fields; thin/no frontend |
| Unit field dual design | Newer unitOfMeasure/priceMode vs older weight/volume fields — reconcile deliberately |
| Parallel inventory-management router | Overlap with /api/inventory — know which UI calls which |
File anchors
| Concern | Path |
|---|---|
| Routes | inventory*.routes.js · inventory-management |
| Services | backend/services/inventory/* · ledger · multi-domain |
| UI | pages/inventory/* |
| Catalog | /admin/catalog/* |
| OAO | 09 Inventory · 29 Small farm |