# README

## Overview

The Inventory module manages physical stock tracking across warehouses and storage locations. It provides real-time visibility into on-hand quantities, records all stock movements (receipts, issues, transfers, adjustments), and supports lot/batch and serial number traceability. The module also handles inventory valuation, physical inventory counts, and scrap disposal.

Inventory operates at the Item level (from item-management) and tracks stock within Warehouses and StorageLocations that the module owns. Organization's Site entity represents the physical facility; Inventory's Warehouse represents the operational storage structure within a Site.

## Key Features

- **Warehouse Management**: Define warehouses and storage locations (zones, bins) within organizational sites
- **Stock Tracking**: Real-time on-hand, reserved, incoming, and blocked quantities per item per location
- **Stock Movement**: Record goods receipts, goods issues, and internal transfers with full audit trail
- **Inventory Adjustment**: Manual corrections for discrepancies, damage, and shrinkage
- **Lot and Batch Tracking**: Lot/batch-level traceability with expiration date management
- **Serial Number Tracking**: Individual item tracking by unique serial number across lifecycle
- **Inventory Valuation**: Cost calculation using FIFO, weighted average, or standard cost methods
- **Inventory Count**: Physical inventory counts and cycle counts with variance review and approval
- **Scrap Management**: Record and track disposal of damaged, expired, or defective stock

## Module Scope

### In Scope

- Warehouse and storage location (zone/bin) definition and management
- Real-time stock level tracking per item per location (on-hand, reserved, incoming, blocked)
- Stock movement recording: goods receipt, goods issue, internal transfer
- Inventory adjustment with reason codes
- Lot/batch assignment, tracking, and expiration date management
- Serial number assignment and lifecycle tracking
- Inventory valuation method configuration (FIFO, weighted average, standard cost)
- Cost-per-unit tracking and valuation amount calculation
- Physical inventory count and cycle count workflows
- Scrap/disposal recording with quantity and valuation impact

### Out of Scope

- Purchase order lifecycle management (purchasing module)
- Sales order and fulfillment workflows (sales module)
- Automated reorder point and replenishment rules (purchasing module)
- Pick/pack/ship multi-step fulfillment (warehouse operations / sales module)
- Putaway rules and automated storage location assignment
- Removal strategies — automated FIFO/FEFO/LIFO picking rules
- Demand forecasting and planning
- Drop-shipping and cross-docking
- Landed cost allocation (purchasing / accounting module)
- Journal entry posting to general ledger (accounting module)
- Barcode scanning device integration (application layer)
- Shipping carrier integration (application layer)

### Scope Decision Rationale

Inventory owns **physical stock state** — where items are, how many exist, and what they cost. This is separated from purchasing (which owns the procurement lifecycle) and sales (which owns the fulfillment lifecycle) because stock tracking follows its own business rules and update patterns.

Warehouse and StorageLocation are owned by this module (not organization) because they represent operational storage structures with inventory-specific attributes (capacity, storage conditions, bin types). Organization's Site represents the physical facility identity and address; Warehouse adds the storage layout within that facility.

Lot/batch and serial number tracking live here (not in item-management) because they are inventory-layer concepts — they track "which specific instances" of an item exist, not "what the item is." Item-management explicitly defers these concerns to the inventory module.

Inventory valuation is included because cost-per-unit is intrinsically tied to stock movements (receipt costs, adjustment impacts). However, posting journal entries to the general ledger is excluded — that responsibility belongs to a future accounting module. Inventory will emit valuation events for downstream consumption.

## Module Dependencies

- [item-management](../item-management/README.md) — Item entity as the primary trackable unit (itemId/SKU)
- [organization](../organization/README.md) — Company for multi-company scoping, Site for warehouse location
- [primitives](../primitives/README.md) — Unit of Measure for stock quantities, Currency for valuation amounts
