The physical model comes first. Warehouses form a self-referencing hierarchy — a main site with child warehouses beneath it, which is how branches are modeled — and each warehouse carries a geocoded location, gates, and access terms. Inside, sectors divide into slots with an explicit capacity and capacity unit, and sectors can enforce storage conditions: minimum and maximum temperature and humidity with alert rules, so sensitive goods are monitored where they sit.
On top of that structure, stock is a transaction ledger rather than an editable balance. Every ledger row records the event that produced it — the supply line received, the sale or dispatch that consumed it — with remaining quantity per row and scoping down to warehouse and sector. Reservations hold stock against requests, sales, and dispatches; internal moves transfer it bin to bin or site to site in a two-phase flow; and items that need it carry lots with expiration dates and serial numbers traceable to their goods receipt.
The control loop closes the module. Inventory counts capture counted quantity against the last recorded quantity per line; warehouse inspections record findings with attachments and can trigger a count; and damaged, expired, or out-of-condition stock goes through a write-off record with reason flags, required justification, and a general ledger account. All-warehouse and single-warehouse dashboards keep the network and each site visible at once — multi-location operation is first-class, not an add-on.