Skip to main content

Sibling services

Eight bounded contexts this service integrates with or used to integrate with, summarised from each repository's own CLAUDE.md and adapter code (facility-layout has had no edge to this service since ADR-0049). Each is an independent Go service with its own model, its own database and its own deployment lifecycle. The other three directly integrated contexts, network-inventory-planning, slotting-optimization and pick-face-replenishment, each feed this service work by Kafka event and are covered on the context map and in Integration events.


inventory-storage — WMS tier, Core​

The WMS-tier authoritative record of what is held where, and what portion is usable.

Implements e-commerce-retailer-style chaotic (random) stow: no fixed product location, an item goes to any free bin and the system records the exact bin. Its defining design rule is the revocable reservation — allocation binds a quantity to demand with a timeout, and revoking returns the quantity to usable, so a physical delivery failure (blocked pod, lost tote, chute jam, short pick) never strands an order.

AggregatesStockUnit (SKU@bin), Bin/Location, Reservation
Key invariantsevery item has exactly one known bin or is flagged Unlocated; a stow requires both item-scan and location-scan; sum(qty) ≤ bin capacity; reserved ≤ usable
PublishesStockReserved, ReservationRevoked on warehouse.inventory.events

Relationship to this service: upstream Customer/Supplier. We consume its two reservation events and project them into UsableInventoryObserved, keyed by SKU. That projection is read-only context: usable, not total, is what constrains release, and this is the only channel through which we learn it.

inventory-storage no longer owns product classification (its ADR 0034): that moved to product-master, below. This service never called inventory-storage for anything else, so since ADR-0035 it makes no call to it at all.


product-master — WMS tier, Supporting​

The single source of truth for SKU-level product master data: handling classification and physical profile.

Owns the Product aggregate: a SKU's handling classification (Hazmat, Fragile, TemperatureSensitive, Oversized, HighValue, a temperature class and a DOT hazard class) and its physical profile (declared vs measured unit dimensions and weight). It calls no sibling service.

AggregateProduct (classification, physical profile)
PublishesProductRegistered, ProductDescriptionChanged, ProductClassified, ProductDimensionsDeclared, ProductMeasured on warehouse.product-master.events (CloudEvents com.warehouse.wms.product-master.product.*, key and subject = the SKU)

Relationship to this service: upstream, Published Language into a local copy. With PRODUCT_CLASSIFICATION_MODE=kafka we consume ProductClassified (stable group PRODUCT_CLASSIFICATION_CONSUMER_GROUP) into product_classification_copy, applying a message only when its version is newer than the stored row, and read that copy once per WorkReleased to stamp the hazmat/fragile hints. A second consumer (stable group PACK_VIEW_CONSUMER_GROUP) reads ProductPackLevelDeclared, ProductPackLevelRetired and ProductPackLevelMeasured into product_pack_level_copy; every other type on the topic is ignored. We never call it (ADR-0035, ADR-0045).


workforce-management — Supporting​

Owns "who is on shift, on which process path, at what rate; direct vs indirect hours."

Two horizons: shift-start headcount planning (a human commits a split across paths) and intra-shift assignment tracking. It stops at the path boundary — it never links an associate to a specific task, because task dispatch and workforce planning change at completely different cadences (shifts versus seconds).

AggregatesAssociateShift, ShiftPlan, LaborAssignment
Key invariantsexactly one active assignment per associate at a time; an assignment must satisfy the path's certification requirement
PublishesShiftPlanCommitted — one message per path line — on warehouse.workforce.events

Relationship to this service: upstream Customer/Supplier. Its ShiftPlan is a labour-side commitment across a building's paths; we project it into LaborPlanObserved and nothing else (ADR-0006). This context's own shift plan, with the plannedHeads ≤ installedStations invariant, moved to warehouse-planning's LabourPlan (ADR-0049).

Note the pleasing symmetry with our RebalanceDecision: Workforce surfaces PathUnderstaffed as a flag, not a decision; we surface ReassignLabor the same way. Neither context moves a person — that is a human call, recorded in Workforce.


fulfillment-execution — Core​

Turns released work into completed physical operations: the task lifecycle for Pick, Pack and SLAM.

Its defining rule is pull, not push: a station calls claimNext(stationId, capabilities) and the system selects work, not workers. Claims carry a lease, so an unconfirmed task returns to the pool rather than vanishing.

AggregatesTask (Pick/Pack/SLAM, leased), Station, Package
Key invariantsat most one active claim; no double-complete; a claim requires matching capabilities; an expired lease frees the task; SLAM diverts when weight is out of tolerance
Consumesour WorkReleased on warehouse.work-planning.events
PublishesTaskCompleted on warehouse.fulfillment.events

Relationship to this service: the only bidirectional pair in the platform — two directed Customer/Supplier relationships. We supply released work; it supplies completion back, which drops our WIP and lets the next release proceed.

The model correspondence is worth being precise about. Our WorkUnit and its Task are different models of the same reality, and both independently enforce at-most-once and no-double-complete on their own side of the boundary. Both also carry a CPT and derive priority from it — the drum is visible in both contexts, which is what makes the handoff coherent without a shared type.


order-management — Generic/Supporting​

Order intake, per-line stock allocation, promise-date calculation, and choreographed release.

It used to call this service's POST /paths/{pathId}/work-units synchronously to release work — a coupling this service's owners rejected once order-management existed as its own context, in favor of the same event-choreography pattern already used by inventory-storage and workforce-management.

PublishesOrderAllocated, OrderPartiallyAllocated on warehouse.order-management.events
Consumesour PathCapacityChanged on warehouse.work-planning.events (its kafkapathcapacity adapter)

Relationship to this service: upstream Customer/Supplier, behind our ACL, same as inventory-storage and workforce-management. We consume both event types identically — each carries order_id, promise_date, and a lines array — and call the existing EnqueueWorkUnit use case once per line, with a deterministic work_unit_id derived as "{order_id}-line-{line_no}". This edge is deliberately fire-and-forget: no reply event is published back to order-management. See Integration events.

In the other direction, order-management consumes our PathCapacityChanged to learn each path's remaining admission capacity per CPT cutoff (ADR-0018); there we are the supplier.


facility-layout — Generic​

The system of record for where things physically are in the building: the site's structural hierarchy and the coded storage slots inside it.

Owns whether a coded location exists, is active, and is legal for a given kind of storage unit — the warehouse map other contexts read but never write. It explicitly does not own occupancy or stock; that stays in inventory-storage.

ModelSite → Zone → Aisle → LocationSlot, plus PlacementRules
Location codeindustry-standard Site-Area-Zone-Aisle-Bay-Level-Position
Read endpointsGET /sites/{siteCode}/layout, GET /distance, among others
Publisheswarehouse.facility.events (not consumed by this service)

Relationship to this service: none since ADR-0049. The commit-time GET /distance lookup was retired with the shift plan, and we do not consume its topic. Classified Generic for the same reason the reference model puts Cartonization there: extract it once rather than duplicating geography in every context.


process-path-management — Generic​

Owns the declared process-path catalogue — which paths exist, their prefixes and whether they are active.

PublishesProcessPathCreated, ProcessPathUpdated, ProcessPathDeactivated on warehouse.process-path-management.events

Relationship to this service: Conformist. Every pathId this service accepts is validated against that catalogue (ADR-0012). With PATH_CATALOGUE_SOURCE=kafka we replay its topic into an in-memory catalogue at boot and follow it live; with the default file source we read the same catalogue from warehouse-infra's YAML.


network-fulfillment — Supporting​

The anti-corruption layer between the fleet and an external retail fulfillment network; owns NetworkOrder and CapabilityOffer.

Consumesour PathCapacityChanged on warehouse.work-planning.events (its pathcapacitycache adapter, one of the Kafka-fed caches behind CapabilityOffer, opt-in via its CAPABILITY_OFFER_ENABLED)

Relationship to this service: downstream, Conformist to our Published Language. Its internal/adapters/outbound/pathcapacitycache replays our topic from the earliest offset under a process-unique consumer group, keeps only com.warehouse.wes.work-planning.workpool.PathCapacityChanged, and caches remaining_units/known per exact (path_id, cutoff_at) pair behind its own ports.PathCapacity. We publish nothing specifically for it and do not call it.


What they all share​

Conventions, not code. Each service re-implements these; none of them is a shared library, so no service can force another to redeploy:

  • Hexagonal / ports-and-adapters with the same strict dependency rule
  • Go, chi, pgx/v5, golang-migrate, segmentio/kafka-go
  • The same CloudEvents 1.0 envelope and type naming convention (ADR-0027), with the cross-service type strings duplicated by agreement, never imported
  • The same real-wiring rule: DATABASE_URL and KAFKA_BROKERS are mandatory, no in-memory or log-only mode (ADR-0044)
  • RFC 7807 problem details, an apis/openapi.yaml linted by Spectral in CI, and a Helm chart

That last point is the real payoff of bounded contexts that agree on conventions while sharing no types: the shape is familiar everywhere, and the models stay independent.