Skip to content

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

AttributeValue
Module IDCORE-07
PhasePhase 1 (Simple), Phase 2 (Multi-location), Phase 3 (Batch/BOM)
PriorityHIGH
DependenciesProduct, 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

IDAs a...I want to...So that...
US-01Business ownerTrack stock quantitiesI know what's in stock
US-02Business ownerReceive inventoryStock levels update on delivery
US-03Business ownerAdjust stock manuallyI can correct mistakes
US-04Business ownerGet low stock alertsI don't run out of products
US-05CashierSee product availabilityI know if items are in stock

Phase 2 - Multi-location Inventory

IDAs a...I want to...So that...
US-06Business ownerCreate multiple warehousesEach store has separate stock
US-07Business ownerTransfer stock between locationsI balance inventory
US-08Business ownerView stock by warehouseI see each location's inventory
US-09Business ownerSet reorder pointsAuto-alerts when stock is low
US-10Warehouse staffPerform stock countsPhysical inventory is accurate

Phase 3 - Advanced Inventory

IDAs a...I want to...So that...
US-11Business ownerTrack batch/lot numbersI trace product origins
US-12Business ownerManage expiry datesI sell older stock first
US-13Business ownerConvert units (box → piece)I track inventory in different units
US-14Business ownerAuto-deduct BOM componentsIngredients deduct on sale
US-15Business ownerView inventory valuationI know my stock's worth

Feature Matrix

FeatureP1P2P3Description
Stock trackingTrack product quantities
Receive stockAdd inventory from suppliers
Manual adjustmentsCorrect stock levels
Low stock alertsNotifications when low
Auto-deduct on saleStock reduces on sale
Multiple warehousesStock per location
Stock transfersMove between warehouses
Stock countsPhysical inventory audits
Reorder pointsAuto-alert thresholds
Batch/lot trackingTrack by batch number
Expiry managementFIFO/FEFO picking
Unit conversionsBox-to-unit tracking
BOM deductionComponent auto-deduct
Inventory valuationStock 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

OperationDescriptionPhaseStock Impact
ReceiveAdd stock from supplierP1+Quantity
SaleDeduct on order completionP1-Quantity
Adjust (+)Manual increaseP1+Quantity
Adjust (-)Manual decreaseP1-Quantity
Transfer OutSend to another warehouseP2-Quantity (source)
Transfer InReceive from another warehouseP2+Quantity (destination)
CountPhysical inventory updateP2±Variance
ReserveAllocate for pending ordersP2-Available
Write-offRemove damaged/expiredP3-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 IDRuleDescription
BR-01Non-negative stockStock quantity cannot be negative
BR-02Warehouse requiredStock must belong to a warehouse
BR-03Product requiredStock entry needs valid product
BR-04Auto-deduct on saleStock deducts when order completes
BR-05FIFO defaultFirst-in-first-out for deduction
BR-06FEFO for expiryFirst-expiry-first-out when tracked
BR-07Transfer same orgTransfers only within organization
BR-08Count locks updatesStock updates pause during count
BR-09Adjustment reasonManual adjustments require reason
BR-10Cost trackingTrack purchase cost for valuation
BR-11Reserve timeoutReserved stock releases after timeout
BR-12Audit trailAll 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 shown

AC-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 viewable

AC-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 history

AC-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 generated

Dependencies

Inventory
├── Requires: Product, Merchant
├── Required by: Orders, Reports
└── Integrates: None (internal operations)
ModuleRelationship
ProductStock tracked per product
MerchantWarehouses linked to stores
OrdersStock deducted on sales
ReportsInventory 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.


Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.