inventory-storage
Core Subdomain · WMS tier
Inventory & Storage is the WMS-tier authoritative record of what is held where, and what portion of it is usable. It is one of the platform's fourteen domain bounded contexts, and it owns the "storing them under chaotic storage" clause of the platform's domain vision — the truth that everything downstream depends on.
The one sentence that explains the whole design:
Every physical item has exactly one known bin, or it is flagged
Unlocated.
Chaotic (random) stow, the item-scan + location-scan rule, cycle counting, and
the Unlocated state are all consequences of taking that sentence literally.
What it owns
| Capability | What that means here |
|---|---|
| Stock ledger | StockUnit aggregates — a quantity of a SKU at a specific bin, with a lifecycle state. |
| Bin-accurate location | Chaotic (random) stow: any SKU may occupy any free bin; the system records the exact bin it landed in. |
| Capacity enforcement | A Bin has a capacity; the sum of stock stowed into it may never exceed it. |
| Revocable reservations | Allocation is a Reservation with a timeout that can always be revoked and re-satisfied from a different physical holding. |
| Usable inventory | The read model that actually constrains release: on-hand minus active reservations minus held/unlocated stock. |
| Cycle counting | Verifying a bin's physical contents against system records, reconciling shortfalls by flagging stock Unlocated. |
| Placement and segregation at stow | Hazmat zone placement and same-bin DOT segregation, enforced at stow time against a version-guarded local copy of product-master's classification (ADR-0034). The classification itself (handling tags, temperature class, DOT hazard class) is owned by product-master since 2026-10-07. |
What it deliberately does not own
- does not pick, pack, ship, or route associates — that is
fulfillment-executionandwes-work-planning; - does not plan labour or headcount — that is
workforce-management; - does not model the physical building (site, area, zone, aisle, bay, level, position) — that is
facility-layout, a separate Generic subdomain; - does not own product master data —
product-masteris the source of truth for a SKU's classification;PUT /products/{sku}/classificationhere answers410(classification-moved), and the deprecatedGETserves the local copy; - does not own bin existence as a place-in-the-building fact —
facility-layoutowns that; aBinhere is a flat, declaratively-registered capacity record, created/resized by inventory control viaPUT /bins/{binId}(ADR-0025), not a node in the warehouse map.
Where this fits in the platform
inventory-storage is an Open Host Service for bin-accurate location and
usable inventory. wes-work-planning is a Customer/Supplier downstream,
conforming to its Published Language (REST + the reservation events) with no
write access to any of its aggregates. order-management
reserves and revokes stock over REST. order-management,
wes-work-planning and fulfillment-execution no longer call its
GET /products/{sku}/classification: each keeps its own local copy of
product-master's classification facts. network-fulfillment reads
GET /inventory/{sku}/usable (opt-in) to compute its capability offers.
It consumes facility-layout's warehouse.facility.events into a local
location-classification cache
(ADR-0013),
product-master's warehouse.product-master.events into its
product_classifications copy (PRODUCT_MASTER_CONSUMER_GROUP, ADR-0034,
set in the reference deployment), inbound-receiving's ReceiptLineReceived
(ADR-0037), network-inventory-planning's transfer
allocation commands (ADR-0030) and fulfillment-execution's TaskCompleted
from warehouse.fulfillment.events (TASK_COMPLETED_CONSUMER_MODE=kafka, set
in the reference deployment): a PICK completion confirms the picked line's
reservation (ADR-0035 and ADR-0036), a RELOCATE completion moves stock
between two bins through RelocateStock (ADR 0039), and a REPLENISH completion does
the same with reason REPLENISHMENT (ADR 0041).
It also publishes BinStockLevelChanged (ADR 0040), the absolute per-bin level
feed that pick-face-replenishment reads.
The legacy ProductClassified and the one-shot
republish-product-classifications backfill that re-emitted it were removed
at product-master ADR 0003 stage E (2026-10-17): product classification is
product-master's alone (ADR-0034).
Sealed cases are tracked as containers (LPNs, ADR-0045 and ADR-0046):
GET /containers/{lpn}, POST /containers/{lpn}/stowages into a case bin,
POST /containers/{lpn}/case-breaks into loose eaches and
GET /bins/{binId}/containers. They raise ContainerRegistered,
ContainerStowed, CaseBroken and ContainerEmptied on
warehouse.inventory.events, keyed by LPN, with no consumer yet.
Every REST and MCP endpoint is unauthenticated by deliberate decision
(ADR-0015). See the
Bounded Context Canvas for the full picture of
who calls in and who is called out to.
Moving stock between bins: relocation
Chaotic storage never had a way to move stock once stowed; slotting needs one.
RelocateStock (ADR 0039) moves a quantity of one SKU between two bins of
one site, atomically on the ledger: both bins' occupancy, the touched
stock units, one new stock unit at the destination, an immutable relocations
record and the outbox row commit in one transaction. Only the usable
(unreserved) quantity moves, so a reservation's pick location never goes
stale. It is reached two ways, and both raise
com.warehouse.wms.inventory-storage.stock.StockRelocated on
warehouse.inventory.events:
POST /relocations(operationrelocateStock, behind theIdempotency-Keymiddleware) andGET /relocations/{id}(getRelocation);- a completed
RELOCATEtask fromfulfillment-execution, applied by theTaskCompletedconsumer from the additivesku,from_bin,to_bin,quantityandrelocation_reffields (reasonSLOTTING,source_ref=relocation_ref, the move reference<plan_id>:<move_seq>); - a completed
REPLENISHtask (ADR 0041), applied by the same consumer from the same fields plus the requiredrequest_ref(reasonREPLENISHMENT,source_ref=request_ref, thepick-face-replenishmentrequest id).warehouse-infradevelopwires the chain:pick-face-replenishmentis deployed andwes-work-planningruns its replenishment consumer withREPLENISHMENT_MODE=kafka(K44).
slotting-optimization consumes StockRelocated to show how far an approved
slot plan has been executed. See Business Context
and Async API.
This context's pages
- Business Context: the domain vision in business language, covering chaotic storage, revocable reservations and usable inventory.
- Ubiquitous Language: the exact vocabulary, taken from the domain code.
- Core Domain Chart (ddd-crew core-domain-charts): why this context is Core.
- Bounded Context Canvas (ddd-crew bounded-context-canvas): purpose, strategic classification, domain roles, communication, business decisions, assumptions and open questions.
- Context Map (ddd-crew context-mapping): every upstream and downstream relationship with its pattern, technology and status.
- Aggregate Design Canvas
(ddd-crew aggregate-design-canvas):
StockUnitandReservation, both aggregate roots. - Domain Events: all twelve
past-tense events this context raises (the catalog on that page). Of
these,
StockReserved,ReservationRevoked,StockRelocated,BinStockLevelChangedand the promotedItemStowed,ItemUnlocatedandDiscrepancyDetectedcross the service boundary on the integration topic, beside the transfer replies and destination facts and the four container facts (see the Async API for the per-topic list). - Domain Message Flow (ddd-crew domain-message-flow-modelling): key scenarios as commands, events and queries.
- EventStorming (ddd-crew eventstorming-glossary-cheat-sheet): process-level boards.
- Class Diagram: the domain model as it exists in the code.
- Entity Relationship: the persisted tables.
- Sequence Diagrams: the main runtime interactions.
- Async API: the Kafka integration in narrative form, with a link to the generated AsyncAPI reference.
Every page above except the Business Context and the Async API narrative
is synced from the inventory-storage repository.
Elsewhere
- Repository: github.com/IQVO/inventory-storage
- This context's own documentation site (ADRs, architecture, quickstart, generated OpenAPI/AsyncAPI reference) is built from
docs/docs/in the repository above by its owndocs.ymlworkflow. - Generated references on this site: REST and AsyncAPI.
- ADR index: links to this context's own decision records.