Skip to main content

Inventory

Stock tracking โ€” the inventory and stockMovement models, and the addStock / removeStock / transferStock acts.

๐Ÿ“„๏ธinventoryManager

inventoryManager.ts is the shared brain behind the inventory acts. Instead of each act inlining its own findOne / $inc / insertOne logic, the mutating acts (addStock, removeStock, transferStock) delegate here, and the read helpers getStockLevel / getProductStockLevels are used by the read acts. You need it to understand the single source of truth for stock: every write updates exactly one inventory document and appends one stockMovement ledger row, so quantity changes are always auditable.