@fayz-ai/inventory
v0.4.6
Published
Fayz SDK inventory context — the stock ledger domain, its repository port and adapters, and the store
Readme
@fayz-ai/inventory
The inventory bounded context: what a product, a stock movement, a count and a recipe are, the rules about them, and where they are stored.
Status: beta — extracted from @fayz-ai/plugin-inventory, which composes it and still re-exports every name it had. Pre-1.0: minor APIs may change before 1.0.
Shaped like every context in the SDK (docs/platform/PATTERNS.md).
There is no entry file: each module is imported by its path. The screens stay in @fayz-ai/plugin-inventory.
Install
npm install @fayz-ai/inventoryModules
| Import | What it holds |
|---|---|
| @fayz-ai/inventory/domain/product | Product, its classification and fichas, derivedProductType, marginPercent, stockValue |
| @fayz-ai/inventory/domain/movement | StockMovement, the one movement vocabulary (MOVEMENT_TYPES, normalizeMovementType) and what a movement does to the ledger and the shelf |
| @fayz-ai/inventory/domain/stock | StockPosition, StockLocation, stockHealth, isLowStock, the summary, the restock queue and the panel rows |
| @fayz-ai/inventory/domain/count | StockCountSession, StockCountItem and the variance arithmetic (lineVariance, summarizeCount) |
| @fayz-ai/inventory/domain/recipe | Recipe, RecipeIngredient, recipe cost and CMV, explodeRecipe |
| @fayz-ai/inventory/domain/consumption | the cross-context boundary a sale uses to consume a recipe exactly once |
| @fayz-ai/inventory/domain/usage-audit | UsageAuditEntry and the correction and approval inputs |
| @fayz-ai/inventory/domain/reference-data | the default measurement units and stock location a tenant starts with |
| @fayz-ai/inventory/data/provider | InventoryDataProvider, the repository port |
| @fayz-ai/inventory/data/supabase | createSupabaseInventoryProvider — writes the ledger only through its RPCs |
| @fayz-ai/inventory/data/mock | createMockInventoryProvider, the same contract in memory |
| @fayz-ai/inventory/data/tables | the physical table names, for registries that edit them directly |
| @fayz-ai/inventory/store | createInventoryStore, createInventoryDataProvider |
import { isLowStock } from '@fayz-ai/inventory/domain/stock'
import { normalizeMovementType } from '@fayz-ai/inventory/domain/movement'
normalizeMovementType('saída') // 'exit'
isLowStock(2, 5) // trueWords used here are defined in GLOSSARY.md.
