Skip to main content

Facility Layout

Study project

This documentation site is an educational Domain-Driven Design exercise. It follows real industry-standard patterns and terminology, but it is not a production system and is not affiliated with, endorsed by, or representative of any real-world company.

Facility Layout is the bounded context that owns where things physically are in the building: a site's structural hierarchy — Site → Area → Zone → Aisle → Bay → Level → Position — and the coded storage slots inside it.

It does not own occupancy or stock. That stays in inventory-storage's Bin and StockUnit aggregates. What this service owns is whether a coded location exists, is active, and is legal for a given kind of storage unit — the warehouse map that other contexts read but never write.

WH1-STOR-AMB-A07-03-02-B
| | | | | | `-- Position: left-to-right slot on the level
| | | | | `----- Level: vertical level / shelf
| | | | `-------- Bay: bay / section along the aisle
| | | `------------ Aisle: physical corridor
| | `---------------- Zone: behavioral class (AMB/CHL/FRZ/HAZ/FWD/RSV/CPK)
| `--------------------- Area: coarse functional area (STOR/RCV/PACK/STAGE)
`-------------------------- Site: the physical facility

What this service is for​

Question a caller asksAnswered by
Does WH1-STOR-AMB-A07-03-02-B exist, and is it active?GET /locations/{locationCode}
May a PalletRack slot legally exist in the frozen zone?Enforced at registration by PlacementRules
What does this building look like, top to bottom?GET /sites/{siteCode}/layout
What does one zone look like as a paintable grid?GET /zones/{zoneId}/grid
Which aisle comes next in walk order?An Aisle's SequenceHint
How far apart are two slots on the map?GET /distance?from=&to= (routed within a zone; straight-line estimate across zones when both slots have position geometry)
Which of a site's slots are dock doors, work centers, QC stations…?GET /sites/{siteCode}/locations?role=
Is this slot in a hazmat or temperature-controlled zone?GET /locations/{locationCode}/classification

Strategic position, in one paragraph​

This is a Generic Subdomain, in the same bucket as Cartonization and WCS in the platform's DDD reference. Physical-location truth is well understood and is not a competitive differentiator, and it is needed by contexts on both sides of the WMS/WES line: inventory-storage needs location validity to accept a stow, and wes-work-planning / fulfillment-execution need zone/aisle adjacency for travel-path and congestion reasoning. Neither owns it; both consume it (as do, over Kafka, warehouse-planning for storage capacity, inbound-receiving, dock-scheduling, yard-management, outbound-shipping, slotting-optimization, pick-face-replenishment, task-interleaving and network-inventory-planning, and warehouse-ops-agent, over MCP). Following the reference's discipline — "extract generic logic instead of duplicating it" — it is therefore its own bounded context and its own service, not a package bolted onto inventory-storage. See Subdomain classification.

The four ideas worth knowing​

  1. The LocationCode is a value object, not a string. Seven typed segments, [A-Z0-9] only, always round-tripping through String()/ParseLocationCode(). See The location code.
  2. Registering a slot is a chain-of-custody check, not an insert. The Site → Zone → Aisle chain the code implies must resolve to existing, Active aggregates. No orphan slots, ever. See Invariants.
  3. PlacementRules are enforced once, at registration time. The rule that keeps ambient shelving out of the frozen zone runs when the slot is created — not on every read, and not in every calling service. See ADR 0003.
  4. "Drawing the warehouse" is a first-class capability. Two read models return renderable structure, not raw rows a client has to join and sort. See Drawing the warehouse.

Where to go next​

Disclaimer

This project is a domain-driven design study. It is not associated with, endorsed by or affiliated with any company, and it uses no company's code, data, logos or trademarks. All names, figures and examples are illustrative or synthetic.