Functional contract

Inventory

On-hand stock is per Location and shipped at /app/inventory. Purchasing identity is per Legal Entity. Catalog identity is per Organization. A unit at Location A never decrements Location B. Transfers and purchase orders are still intended.

On-hand shipped Transfers and POs not built

Stock control

Each catalog item has a master stock_control (not a Location override):

ModeBehavior
No control (none)No stock rows. Absent from Inventory. Default for services.
Control without batch (quantity)One on-hand integer per Location. Default for products.
Control with batch (batch)On-hand is the sum of lots at that Location (lot number, optional expiry, quantity). Adjustments must name a lot.

Changing mode is rejected while stock remains. Quantity cannot go negative. Adjustments write an InventoryAdjustment ledger.

Effective enabled identity still comes from Catalog and pricing. Exclusive items are only stocked where they are granted.

Transfers between Locations

Intended. Not implemented. Sites in the same Organization may move stock with a documented transfer. Traceability is required: who sent, who received, what, how many, when.

StepBehavior
CreateSource Location (or an Organization admin) starts a transfer to another Location in the same Organization
In transitQuantity has left the source and is not yet available at the destination
ReceiveDestination confirms; quantity becomes on hand there
Cancel / rejectStock returns to the source if it had already left; no silent disappear

Do not allow transfers to a Location in another Organization.

Purchase orders

Intended. Not implemented. Purchase orders are issued in the name of a Legal Entity.

Visibility

ActorSees
Organization adminOn-hand at every Location
Location manager / staffOn-hand for granted Locations only

Acceptance

Out of scope: reorder points, lot recalls, controlled-substance registers, vendor EDI, intercompany invoices for cross-EIN transfers.