Work in Progress
Feature details in this document may change during investigation, discussion, design, and implementation phases.
Inventory / Kho hàng
Warehouse and stock management for your business.
Overview
| Attribute | Value |
|---|---|
| Module ID | CORE-07 |
| Phase | Phase 1 (Simple), Phase 2 (Multi-location), Phase 3 (Batch/BOM) |
| Priority | HIGH |
| Dependencies | Product, Merchant |
The Inventory module manages stock levels, warehouse operations, and inventory tracking. It scales from simple stock counting to complex multi-warehouse management with batch tracking, unit conversions, and bill of materials support.
┌─────────────────────────────────────────────────────────────────┐
│ INVENTORY OPERATIONS │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ │
│ │ SUPPLIER │ │
│ └──────┬──────┘ │
│ │ Purchase/Receive │
│ ▼ │
│ ┌─────────────────────────────────────────────┐ │
│ │ WAREHOUSE │ │
│ │ ┌─────────────────────────────────────┐ │ │
│ │ │ STOCK LEVELS │ │ │
│ │ │ Product A: 100 units │ │ │
│ │ │ Product B: 50 units │ │ │
│ │ │ Product C: LOW (10 units) │ │ │
│ │ └─────────────────────────────────────┘ │ │
│ └──────┬───────────────────────────┬──────────┘ │
│ │ Transfer │ Sale │
│ ▼ ▼ │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ WAREHOUSE │ │ POS │ │
│ │ #2 │ │ (Deduct) │ │
│ └─────────────┘ └─────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘User Stories
Phase 1 - Simple Inventory
| ID | As a... | I want to... | So that... |
|---|---|---|---|
| US-01 | Business owner | Track stock quantities | I know what's in stock |
| US-02 | Business owner | Receive inventory | Stock levels update on delivery |
| US-03 | Business owner | Adjust stock manually | I can correct mistakes |
| US-04 | Business owner | Get low stock alerts | I don't run out of products |
| US-05 | Cashier | See product availability | I know if items are in stock |
Phase 2 - Multi-location Inventory
| ID | As a... | I want to... | So that... |
|---|---|---|---|
| US-06 | Business owner | Create multiple warehouses | Each store has separate stock |
| US-07 | Business owner | Transfer stock between locations | I balance inventory |
| US-08 | Business owner | View stock by warehouse | I see each location's inventory |
| US-09 | Business owner | Set reorder points | Auto-alerts when stock is low |
| US-10 | Warehouse staff | Perform stock counts | Physical inventory is accurate |
Phase 3 - Advanced Inventory
| ID | As a... | I want to... | So that... |
|---|---|---|---|
| US-11 | Business owner | Track batch/lot numbers | I trace product origins |
| US-12 | Business owner | Manage expiry dates | I sell older stock first |
| US-13 | Business owner | Convert units (box → piece) | I track inventory in different units |
| US-14 | Business owner | Auto-deduct BOM components | Ingredients deduct on sale |
| US-15 | Business owner | View inventory valuation | I know my stock's worth |
Feature Matrix
| Feature | P1 | P2 | P3 | Description |
|---|---|---|---|---|
| Stock tracking | ✓ | Track product quantities | ||
| Receive stock | ✓ | Add inventory from suppliers | ||
| Manual adjustments | ✓ | Correct stock levels | ||
| Low stock alerts | ✓ | Notifications when low | ||
| Auto-deduct on sale | ✓ | Stock reduces on sale | ||
| Multiple warehouses | ✓ | Stock per location | ||
| Stock transfers | ✓ | Move between warehouses | ||
| Stock counts | ✓ | Physical inventory audits | ||
| Reorder points | ✓ | Auto-alert thresholds | ||
| Batch/lot tracking | ✓ | Track by batch number | ||
| Expiry management | ✓ | FIFO/FEFO picking | ||
| Unit conversions | ✓ | Box-to-unit tracking | ||
| BOM deduction | ✓ | Component auto-deduct | ||
| Inventory valuation | ✓ | Stock value reporting |
Warehouse Types
┌─────────────────────────────────────────────────────────────────┐
│ WAREHOUSE TYPES │
├─────────────────────────────────────────────────────────────────┤
│ │
│ TYPE USE CASE EXAMPLE │
│ ───────────────────────────────────────────────────────────── │
│ │ │
│ ├── MAIN Central storage Central depot │
│ │ │
│ ├── STORE Point-of-sale stock Retail store │
│ │ │
│ ├── TRANSIT In-transfer goods Moving stock │
│ │ │
│ ├── VIRTUAL Non-physical Consignment │
│ │ │
│ └── DAMAGED Defective items Returns, QC │
│ │
└─────────────────────────────────────────────────────────────────┘Stock Operations
| Operation | Description | Phase | Stock Impact |
|---|---|---|---|
| Receive | Add stock from supplier | P1 | +Quantity |
| Sale | Deduct on order completion | P1 | -Quantity |
| Adjust (+) | Manual increase | P1 | +Quantity |
| Adjust (-) | Manual decrease | P1 | -Quantity |
| Transfer Out | Send to another warehouse | P2 | -Quantity (source) |
| Transfer In | Receive from another warehouse | P2 | +Quantity (destination) |
| Count | Physical inventory update | P2 | ±Variance |
| Reserve | Allocate for pending orders | P2 | -Available |
| Write-off | Remove damaged/expired | P3 | -Quantity |
Key Flows
Stock Receive Flow
Stock Transfer Flow (Phase 2)
Sale Deduction Flow
Stock Count Flow (Phase 2)
Low Stock Alert Flow
Business Rules
| Rule ID | Rule | Description |
|---|---|---|
| BR-01 | Non-negative stock | Stock quantity cannot be negative |
| BR-02 | Warehouse required | Stock must belong to a warehouse |
| BR-03 | Product required | Stock entry needs valid product |
| BR-04 | Auto-deduct on sale | Stock deducts when order completes |
| BR-05 | FIFO default | First-in-first-out for deduction |
| BR-06 | FEFO for expiry | First-expiry-first-out when tracked |
| BR-07 | Transfer same org | Transfers only within organization |
| BR-08 | Count locks updates | Stock updates pause during count |
| BR-09 | Adjustment reason | Manual adjustments require reason |
| BR-10 | Cost tracking | Track purchase cost for valuation |
| BR-11 | Reserve timeout | Reserved stock releases after timeout |
| BR-12 | Audit trail | All stock changes logged |
Acceptance Criteria
AC-01: Stock Tracking
GIVEN a product with inventory tracking enabled
WHEN viewing the product
THEN - Current stock level is displayed
- Stock by warehouse shown (P2)
- Low stock indicator if below threshold
- Last stock movement date shownAC-02: Stock Receive
GIVEN a warehouse and products to receive
WHEN staff completes a stock receipt
THEN - Stock levels increase by received quantity
- Receipt is recorded with timestamp
- Cost is recorded for valuation
- Receipt history is viewableAC-03: Sale Deduction
GIVEN a completed order with tracked products
WHEN order status changes to completed
THEN - Stock is automatically deducted
- Stock movement is logged
- If stock insufficient, warning shown
- Order still completes (soft warning)AC-04: Stock Transfer (Phase 2)
GIVEN stock in Source Warehouse A
WHEN transfer to Destination Warehouse B
THEN - Source stock decreases
- Destination stock increases
- Transfer record created
- Both warehouses show historyAC-05: Low Stock Alert
GIVEN a product with reorder point = 10
WHEN stock falls to 10 or below
THEN - Alert notification sent
- Product shows low stock status
- Dashboard shows alert count
- Email sent (if configured)AC-06: Stock Count (Phase 2)
GIVEN a warehouse with expected stock
WHEN physical count is performed
THEN - Variance is calculated
- Adjustments are applied
- Count history is recorded
- Variance report generatedDependencies
Inventory
├── Requires: Product, Merchant
├── Required by: Orders, Reports
└── Integrates: None (internal operations)| Module | Relationship |
|---|---|
| Product | Stock tracked per product |
| Merchant | Warehouses linked to stores |
| Orders | Stock deducted on sales |
| Reports | Inventory reports |
Integration Points
Stock Valuation Methods
┌─────────────────────────────────────────────────────────────────┐
│ VALUATION METHODS │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Method Description Use Case │
│ ───────────────────────────────────────────────────────────── │
│ │ │
│ ├── FIFO First-In-First-Out Default method │
│ │ Oldest cost first │
│ │ │
│ ├── LIFO Last-In-First-Out Tax optimization │
│ │ Newest cost first │
│ │ │
│ ├── Average Weighted Average Stable pricing │
│ │ Running average cost │
│ │ │
│ └── Specific Per-batch tracking High-value items │
│ Individual cost │
│ │
│ Default: FIFO (recommended for Vietnam tax compliance) │
│ │
└─────────────────────────────────────────────────────────────────┘Picking Strategies (Phase 3)
┌─────────────────────────────────────────────────────────────────┐
│ PICKING STRATEGIES │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Strategy Rule Best For │
│ ───────────────────────────────────────────────────────────── │
│ │ │
│ ├── FIFO Pick oldest first General retail │
│ │ │
│ ├── FEFO Pick earliest expiry Food, Pharmacy │
│ │ first │
│ │ │
│ └── Manual User selects batch Special cases │
│ │
└─────────────────────────────────────────────────────────────────┘Screenshots
Screenshots
Screenshots will be added after UI implementation.