Pick-Face Replenishment
pick-face-replenishment is the bounded context that keeps every forward pick face 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 more than the policy maximum. It closes the request when
inventory-storage records the matching relocation.
| Tier | WMS (CloudEvents type segment wms, source /warehouse/pick-face-replenishment) |
| Subdomain class | Supporting (reasoning) |
| Binary | one: cmd/api (REST, outbox relay and three Kafka consumers in one process, all always on) |
| Datastore | PostgreSQL (required: there is no in-memory mode, ADR 0006) |
| Messaging | Kafka, CloudEvents 1.0 structured mode, transactional outbox |
| Auth | none (fleet decision 2026-09-11) |
| Repository | IQVO/pick-face-replenishment, site https://iqvo.github.io/pick-face-replenishment/ |
What it owns
- ReplenishmentPolicy: the
MIN_MAXrule of one (site, SKU):minQty,maxQty,multiple, aversionfor optimistic concurrency. Declared and removed through REST. - ReplenishmentRequest: one decision to move stock from one reserve bin to one forward bin, in the states
Requested,CompletedandCancelled. At most one is open per (site, forward bin, SKU). - The detector: a pure function that 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.
It does not own stock levels, slot assignments or locations. Those arrive as events and live in local copies
(bin_stock_levels, forward_assignments, zones, locations); the service never calls a sibling context
(Integration). It creates no floor work and never writes the stock ledger.
Main capabilities
- Declare policies with
PUT /policies/{siteId}/{sku}(If-Matchversioning) and publish the analytics factReplenishmentPolicyDeclared. - See every pick face with its status (
BELOW_MIN,OK,NO_SOURCE,NO_POLICY) throughGET /pick-faces. - Raise requests three ways: automatically when a bin level or a new forward map is applied, with the sweep
POST /sites/{siteId}/evaluations, or by hand withPOST /replenishments. - Complete requests from inventory-storage's
StockRelocated(reasonREPLENISHMENT,source_ref= the request id), recording the units actually moved. - Cancel requests on the operator's word, when a newer approved slot plan drops the assignment, or when the policy is removed.
- Publish
ReplenishmentRequested,ReplenishmentCompletedandReplenishmentCancelledonwarehouse.pick-face-replenishment.events(and again on the analytics topic) through a transactional outbox.
Status of the execution chain
Replenishment is meant to run through the relocation chain pick-face-replenishment, wes-work-planning (REPLENISH
work), fulfillment-execution, inventory-storage (RelocateStock) and back as StockRelocated. Checked on each sibling's
origin/develop: the inputs from slotting-optimization and facility-layout are live, inventory-storage publishes
BinStockLevelChanged (its ADR 0040) and a StockRelocated with reason REPLENISHMENT for a completed REPLENISH
task (its ADR 0041), fulfillment-execution creates, announces and completes REPLENISH tasks (its ADR 0050),
wes-work-planning consumes ReplenishmentRequested and plans one REPLENISH work unit per request id, releasing it with
a replenishment object on WorkReleased (its ADR 0042), and process-path-management declares the REPLENISH path (its
ADR 0036). The chain is therefore built end to end on develop. In warehouse-infra this service is registered and
wes-work-planning has REPLENISHMENT_MODE=kafka (cluster state was not checked), but until the REPLENISH path is seeded in a cluster wes-work-planning dead-letters the requests.
The per-edge table is on Integration.
Where to go next
| I want to | Page |
|---|---|
| understand the layout and the moving parts | Architecture |
| run it and make the first calls | Quickstart |
| configure it | Configuration |
| deploy, migrate and operate it | Runbook |
| watch it | Observability |
| debug it | Troubleshooting |
| test it | Testing |
| know what it talks to | Integration |
| read the behaviour use case by use case | Use cases |
| read the REST and event contracts | API reference, Event catalogue |
| see why it was built this way | ADR index, DDD artifacts |
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.