Pick-Face Replenishment
Pick-Face Replenishment is one of the fleet's sixteen domain bounded
contexts. It sits in the wms tier of the CloudEvents subdomain taxonomy, the
sixth wms context after facility-layout, inventory-storage,
product-master, inbound-receiving and slotting-optimization, which it
extends: slotting decides which SKU holds which forward slot, this context
keeps that slot stocked. It holds an explicit min/max policy per site and
SKU, watches the stock level of each forward bin through event-fed local
copies, and when the projected level reaches the minimum it raises a
replenishment request: move a quantity of the SKU from the fullest reserve
bin to the forward bin, never above the policy maximum. It closes the request
when inventory-storage records the matching relocation.
Per this context's own Context Map
and integration page,
checked against develop (and, for deployment, warehouse-infra develop):
Built on develop (cac857d): the REST API (fourteen path × method
pairs in apis/openapi.yaml, including the two analytics report routes,
/healthz and /readyz), the transactional outbox and relay, and four
Kafka consumers, always on since its ADR 0006 (DATABASE_URL, KAFKA_BROKERS
and every consumer group are mandatory and a missing one is a boot error): bin
levels and relocations from inventory-storage, the forward map from
slotting-optimization, zones and locations from facility-layout, and
product-master's pack levels (its ADR 0009, the pack-derived replenishment
multiple). It ships four binaries: cmd/api, a read-only MCP server
(cmd/mcp, ADR 0007) and the analytics read side cmd/pfr-projector +
cmd/pfr-reports (ADR 0008), plus a Dockerfile, a Helm chart and the console
remote replenishment_mfe.
Wired in warehouse-infra develop: terraform/apps.yaml registers it
(database, analytics database, frontend_remote: replenishment_mfe) and
helm-values/pick-face-replenishment.yaml sets all four consumer groups
(inventory, slotting, layout, pack-levels) and the analytics projector.
warehouse-ops-agent has an MCP client for it
(internal/adapters/outbound/mcpclient/pick_face_replenishment.go). The kind
cluster was not checked.
What is built around it, checked on each sibling's develop: the inputs
from slotting-optimization (SlotPlanApproved) and facility-layout (zones
and location slots) are published by live producers, and so are the two
inventory-storage inputs: inventory-storage publishes BinStockLevelChanged
(its ADR 0040) and records a completed REPLENISH task as a StockRelocated
with the reason REPLENISHMENT and source_ref equal to the request id (its
ADR 0041). The output side is built too, hop by hop (fleet edge K44):
wes-work-planningconsumesReplenishmentRequestedandReplenishmentCancelledand plans oneREPLENISHwork unit per request id (its ADR 0042,internal/adapters/inbound/kafka/replenishment_consumer.go). The consumer is opt-in:REPLENISHMENT_MODE=kafkawith a stableREPLENISHMENT_CONSUMER_GROUP; the defaultpermissiveconsumes nothing.process-path-managementdeclares theREPLENISHpath (its ADR 0036:catalogue/paths.json, intakeREPLENISHMENT), applied by itsscripts/seed_catalogue.py.wes-work-planningreleases the unit with the additivereplenishmentobject onWorkReleased, andfulfillment-executioncreates aREPLENISHtask from it, announces it and reportsTaskCompletedwithrequest_ref(its ADR 0050).inventory-storageapplies that completion as theREPLENISHMENTrelocation that closes the request (K43), andslotting-optimizationno longer mistakes aREPLENISHMENTmove for a slot-plan move (its PR #35).
So on develop a request can be raised, planned, executed and completed, and
every hop is wired in warehouse-infra develop (this service's values file,
REPLENISHMENT_MODE=kafka for wes-work-planning). The REPLENISH path
reaches a cluster only through the catalogue seed (an operator step), and no
request has been traced through all five hops on a cluster.
Planned, not built: a demand-cover policy behind the same port as
MIN_MAX.
It owns two aggregates and one pure function:
ReplenishmentPolicy(packageinternal/domain/policy): theMIN_MAXrule of one (site, SKU) withminQty,maxQty,multipleand aversionfor optimistic concurrency. Declared and removed through REST.ReplenishmentRequest(packageinternal/domain/replenishment): one decision to move stock from one reserve bin to one forward bin, in the statesRequested,CompletedandCancelled. At most one is open per (site, forward bin, SKU).- The detector (package
internal/domain/detection): turns a pick face, its policy, its open request and the candidate reserve bins into one of five verdicts (Raise,Healthy,AlreadyOpen,NoPolicy,NoSource). The source bin policy isfullest-reserve-bin-v1.
This context's pages
- Business Context: the gap, what it owns, the v1 policy, and what the context deliberately does not do.
- Ubiquitous Language: pick face, forward bin, reserve bin, policy, request, projected level, priority, source bin policy.
- Core Domain Chart: Supporting, and why.
- Bounded Context Canvas (ddd-crew bounded-context-canvas): purpose, classification, roles, communication, decisions.
- Context Map: every edge with its pattern, technology and state, planned edges labelled.
- Aggregate Design Canvas:
ReplenishmentPolicyandReplenishmentRequest. - Domain Events: the four published events and the six consumed ones.
- Domain Message Flow, EventStorming, Class Diagram, Entity Relationship, Sequence Diagrams and Use Cases.
- Operations: Configuration, Runbook, Observability, Troubleshooting and Testing.
- Async API: the Kafka narrative.
- Generated references: REST and AsyncAPI.
Elsewhere
- Repository: github.com/IQVO/pick-face-replenishment,
with its own docs site at
iqvo.github.io/pick-face-replenishment.
Its ADRs live under
docs/adr/: 0001 (bounded context), 0002 (the two aggregates, their invariants and the detection policy), 0003 (event-fed local copies and the consumed contracts), 0004 (CloudEvents envelope and type catalogue), 0005 (evaluation semantics and persistence), 0006 (Postgres and Kafka are the only runtime), 0007 (MCP server), 0008 (analytics read side) and 0009 (pack-derived replenishment multiple). - Fleet-level: Context Map (K39, K40,
K42 to K44 and the pack-level edge K62, all live: built on both ends and
wired in
warehouse-infradevelop), the Event Standard (subdomain table and type catalogue), Subdomain Classification and the Ubiquitous Language.