Facility Layout
Generic Subdomain · WMS-adjacent, extracted once
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)
| `--------------------- Area: coarse functional area (STOR/RCV/PACK/STAGE)
`-------------------------- Site: the physical facility
Why it is a Generic Subdomain
Physical-location structure is well understood, has an established industry
pattern, and is not where the platform wins competitively. It is needed by
contexts on both sides of the WMS/WES line — inventory-storage needs
location validity to accept a stow, wes-work-planning and
fulfillment-execution need zone/aisle adjacency for travel-path and
congestion reasoning — and neither owns it. Following the platform's DDD
reference discipline of "extract generic logic instead of duplicating it,"
it is extracted once into its own bounded context and its own service,
rather than a package bolted onto inventory-storage. See
Business context and
Bounded Context Canvas for the full argument.
Integration status
This context is an Open Host Service with a Published Language, and it has no outbound dependency on any other service. It calls no one and consumes no other context's events. Its relationships, per its own Context Map, are:
- Kafka,
warehouse.facility.events: withEVENT_PUBLISHER=kafka, all fifteen domain event types are published as CloudEvents 1.0 (structured mode,typeprefixcom.warehouse.wms.facility-layout.), through a transactional outbox when a database is configured (ADR 0018). The contract isapis/asyncapi.yaml. The consumers ondevelop(each repository's own consumer code):inventory-storagefeeds a local location-classification cache fromZoneRegistered,LocationSlotRegistered,LocationSlotDecommissionedandLocationSlotHandlingUnitDeclared(LOCATION_LOOKUP_MODE=kafka) for its stow-time placement check and, for the handling unit (EACH,CASEorPALLET, declared withPUT /locations/{locationCode}/handling-unit, ADR 0040), whether a sealed case may be stowed in a bin.warehouse-planningfoldsLocationSlotRegisteredandLocationSlotDecommissionedinto a storage-position and station tally.inbound-receiving,slotting-optimization,pick-face-replenishmentandtask-interleavingkeep local slot (and, exceptinbound-receiving, zone) copies from the same topic;task-interleavingalso readsLocationGeometryUpdated.network-inventory-planningconsumesSiteCapabilityChanged(the site capability heartbeat, ADR 0041).
- REST:
wes-work-planningcallsGET /distancefor travel distance (TRAVEL_DISTANCE_MODE=http).fulfillment-executionhas an opt-inGET /locations/{locationCode}lookup for a slot's functionalrole(LOCATION_ROLE_MODE=http, defaultpermissive;warehouse-infradevelopsetshttpsince its #92, with aterraform applypending).inventory-storagekeepsGET /locations/{locationCode}/classificationas a wired rollback path (LOCATION_LOOKUP_MODE=http). The geometry and role features behind these calls come from ADR 0016 (location roles) and ADR 0017 (geometry and travel graph). - MCP and reports:
warehouse-ops-agentreadslist_sites,get_site_layout,get_zone_gridandestimate_travel_distance, plus the catalog-growth report. - Console: the
facility-mfeModule Federation remote is this context's own operator UI.
workforce-management is Separate Ways by design. REST and MCP are
unauthenticated by deliberate decision (ADR 0015).
This context's pages
- Business Context: the location-code hierarchy, and why this concern is extracted rather than duplicated.
- Ubiquitous Language: the exact vocabulary this context speaks.
- Core Domain Chart (ddd-crew core-domain-charts): why this context is Generic.
- Bounded Context Canvas (ddd-crew bounded-context-canvas): purpose, classification, communication, decisions and open questions.
- Context Map (ddd-crew context-mapping): every downstream relationship with its pattern, technology and status.
- Aggregate Design Canvas
(ddd-crew aggregate-design-canvas):
LocationSlot, the leaf aggregate, and its place in the Site, Zone and Aisle hierarchy. - Domain Events: the fifteen
past-tense events published to
warehouse.facility.events, and who consumes them. - 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.
Every page above except the Business Context is synced from the
facility-layout repository. This context has no Async API narrative page.
Elsewhere
- Repository: source, ADRs, and
the real
apis/openapi.yamlandapis/asyncapi.yaml. - REST API Reference and AsyncAPI Reference, generated from those specs.
- ADR index: links to this context's own decision records.