SansiStore’s inventory module gives users with theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ProcesosAgilesUMSS/sansistore/llms.txt
Use this file to discover all available pages before exploring further.
operador_inv role a dedicated workspace to maintain accurate stock counts, log every product movement, and respond to discrepancies before they affect order fulfillment. All inventory data is stored in Firestore and streamed in real time to the dashboard, so operators always see current stock levels without a page refresh.
Inventory pages
The module is accessible at/inventory and contains six sub-pages, each focused on a distinct operational task.
Panel general
Real-time stock dashboard. Shows all products with their current
stockAvailable, stockReserved, and stockTotal. Filterable by stock status (low / normal) and category.Mis productos
Product catalog maintained by inventory operators. Create, edit, and toggle products active or inactive. Each product record links to an
inventory document via the same product ID.Entrada y salida stock
Form for logging physical stock changes. Choose ENTRADA or SALIDA, select a product, enter a quantity and reason. Every confirmed operation writes an atomic batch to both the
inventory and inventoryMovements collections.Historial de movimientos
Paginated log of all
inventoryMovements documents ordered by createdAt descending. Each row shows product, movement type, reason, operator name, and quantity delta. Tie-breaking uses the sequence field for same-millisecond batch writes.Pedidos con fallos
Lists orders whose status is
NO ENTREGADO or CANCELADO. Operators can release reserved stock by decrementing stockReserved in a single Firestore transaction, which also records an ENTRADA movement for audit purposes and sets stockRestored: true on the order.Mis empaques
Tracks order dispatch and warehouse handover. Operators prepare packages for orders and record the physical handover to the courier before pickup.
Inventory Firestore model
Each product has a corresponding document in theinventory collection, keyed by the same productId. The dashboard merges both products and inventory snapshots client-side to build DashboardProduct objects.
| Field | Type | Description |
|---|---|---|
stockTotal | number | Total physical units in the warehouse |
stockAvailable | number | Units available for new orders |
stockReserved | number | Units reserved by orders that are pending delivery |
minStock | number | Threshold below which a low-stock alert fires |
enabled | boolean | Whether the product is active in inventory tracking |
updatedAt | Timestamp | Last time any inventory field was modified |
stockAvailable and stockTotal are updated together by StockMovementForm on every ENTRADA or SALIDA batch write (both fields are incremented or decremented by the same quantity). stockReserved is managed separately by the order and fulfillment services. When stockAvailable drops at or below minStock, the dashboard highlights the product row and a StockAlertToast is shown to the operator. This threshold is configurable per product.Stock replenishment flow
The following steps describe how an inventory operator handles a new supplier delivery from end to end.Log the incoming batch
Navigate to Entrada y salida stock (
/inventory/entrysExits). Select movement type ENTRADA, choose the product and category, enter the quantity received, and select the reason Lote nuevo. When “Lote nuevo” is chosen, the form also requires the total purchase cost (totalCost) for the batch so the unit cost can be calculated.Review and confirm the sale price
Before saving, a confirmation modal displays the computed unit cost (
totalCost ÷ quantity) alongside the current sale price. The operator can update the product’s public sale price in the same step. This update is applied atomically to the products document inside the same Firestore batch.Batch write to Firestore
Clicking Confirmar y Guardar commits a single
writeBatch that:- Increments
stockTotalandstockAvailableon theinventorydocument. - Creates a new
inventoryMovementsdocument withtype: ENTRADA,quantity,operatorId,reason,totalCost, andunitCost. - Optionally updates the product sale price in
products.
Verify in movement history
Open Historial de movimientos (
/inventory/movements) to confirm the new ENTRADA record appears at the top of the list. The dashboard on /inventory will also reflect the updated stockAvailable in real time.