Skip to main content

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.

TierWMS (CloudEvents type segment wms, source /warehouse/pick-face-replenishment)
Subdomain classSupporting (reasoning)
Binaryone: cmd/api (REST, outbox relay and three Kafka consumers in one process, all always on)
DatastorePostgreSQL (required: there is no in-memory mode, ADR 0006)
MessagingKafka, CloudEvents 1.0 structured mode, transactional outbox
Authnone (fleet decision 2026-09-11)
RepositoryIQVO/pick-face-replenishment, site https://iqvo.github.io/pick-face-replenishment/

What it owns​

  • ReplenishmentPolicy: the MIN_MAX rule of one (site, SKU): minQty, maxQty, multiple, a version for 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, Completed and Cancelled. 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 is fullest-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​

  1. Declare policies with PUT /policies/{siteId}/{sku} (If-Match versioning) and publish the analytics fact ReplenishmentPolicyDeclared.
  2. See every pick face with its status (BELOW_MIN, OK, NO_SOURCE, NO_POLICY) through GET /pick-faces.
  3. 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 with POST /replenishments.
  4. Complete requests from inventory-storage's StockRelocated (reason REPLENISHMENT, source_ref = the request id), recording the units actually moved.
  5. Cancel requests on the operator's word, when a newer approved slot plan drops the assignment, or when the policy is removed.
  6. Publish ReplenishmentRequested, ReplenishmentCompleted and ReplenishmentCancelled on warehouse.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 toPage
understand the layout and the moving partsArchitecture
run it and make the first callsQuickstart
configure itConfiguration
deploy, migrate and operate itRunbook
watch itObservability
debug itTroubleshooting
test itTesting
know what it talks toIntegration
read the behaviour use case by use caseUse cases
read the REST and event contractsAPI reference, Event catalogue
see why it was built this wayADR index, DDD artifacts
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.