Slotting Optimization
Slotting Optimization is one of the fleet's sixteen domain bounded
contexts. It sits in the wms tier of the CloudEvents subdomain taxonomy, the
fifth wms context after facility-layout, inventory-storage,
product-master and inbound-receiving. It decides which SKUs deserve a
forward pick slot, and which slot each one gets. It computes a reviewable
proposal (a slot plan), a human approves or rejects it, and an approved plan
is published as a CloudEvent carrying the full forward assignment map and the
physical moves it implies.
Per this context's own Context Map
and integration page,
checked against develop (and, for deployment, warehouse-infra develop):
Built on develop (294de06): the REST API (eleven path × method pairs
in apis/openapi.yaml, including /healthz, /readyz and the two analytics
report routes), the transactional outbox and relay, five Kafka consumers
(demand from order-management, product facts and pack levels from
product-master — the pack-level consumer feeds the case-pick faces of its
ADR 0012 — zones and slots from facility-layout, and executed relocations
from inventory-storage), a read-only MCP server (cmd/mcp, ADR 0005), the
analytics read side (cmd/slotting-projector, cmd/slotting-reports,
ADR 0006) and the console remote slotting_mfe. Postgres and Kafka are the
only runtime (ADR 0011): every consumer mode defaults to kafka, and
permissive or off is a boot error.
Slot-plan execution is built, end to end (ADR 0010, which supersedes
ADR 0007). Approving a plan publishes SlotPlanApproved;
wes-work-planning plans one RELOCATE work unit per move (its ADR 0040);
fulfillment-execution runs the task and its TaskCompleted carries the
moved SKU, bins and counted quantity (its ADR 0047); inventory-storage
applies it as RelocateStock and raises StockRelocated (its ADR 0039);
this context consumes that into per-plan execution progress on
GET /slot-plans/{planId}. It never creates floor work and never writes the
stock ledger itself.
Wired in warehouse-infra develop: terraform/apps.yaml registers it
(database, analytics database, frontend_remote: slotting_mfe) and
helm-values/slotting-optimization.yaml turns on the Kafka publisher and all
five consumers, so the edges are live. The RELOCATE process path must be
seeded in process-path-management first. warehouse-ops-agent has an MCP
client for it (internal/adapters/outbound/mcpclient/slotting_optimization.go).
The kind cluster was not checked.
Not owned here: REPLENISH (min/max) work belongs to
pick-face-replenishment (wms, Supporting), built on develop
(2026-10-17). It consumes this context's SlotPlanApproved as the forward map and is wired
in warehouse-infra develop, so the edge is live (K39 in the fleet
Context Map). The whole loop it needs is built and wired:
inventory-storage publishes BinStockLevelChanged and the REPLENISHMENT relocation reason
(its ADR 0040 and ADR 0041), wes-work-planning plans REPLENISH work from
ReplenishmentRequested (its ADR 0042, REPLENISHMENT_MODE=kafka in warehouse-infra),
process-path-management declares the REPLENISH path (its ADR 0036) and fulfillment-execution
runs REPLENISH tasks (its ADR 0050). That is K44, live; no request has been traced through
every hop on a cluster.
This context's own RecordRelocation ignores a REPLENISHMENT relocation: since its PR #35 only reason
SLOTTING executes a slot-plan move.
It owns one aggregate, SlotPlan (package internal/domain/slotplan),
generated as a Draft by the abc-velocity-v1 policy (package
internal/domain/planning) and moved to Approved or Rejected by a human.
Approving a plan supersedes the site's previous Approved plan in the same
transaction (Superseded is the fourth state).
This context's pages
- Business Context: the gap, what it owns, the v1 policy, the decisions taken, and what the context deliberately does not do.
- Ubiquitous Language: slot plan, forward slot, assignment, move, velocity, demand window, stickiness, local copy.
- Core Domain Chart: Supporting, and why.
- Bounded Context Canvas (ddd-crew bounded-context-canvas): purpose, classification, roles, inbound and outbound communication, business decisions and open questions.
- Context Map: every edge with its pattern, technology and state, planned edges labelled.
- Aggregate Design Canvas:
SlotPlan. - Domain Events: the three published events and the eight consumed ones.
- Domain Message Flow, EventStorming, Class Diagram, Entity Relationship, Sequence Diagrams and Use Cases.
- Async API: the Kafka narrative.
- Generated references: REST and AsyncAPI.
Elsewhere
- Repository: github.com/IQVO/slotting-optimization,
with its own docs site at
iqvo.github.io/slotting-optimization.
Its ADRs live under
docs/adr/: 0001 (bounded context), 0002 (theSlotPlanaggregate, its invariants and theabc-velocity-v1policy), 0003 (event-fed local copies and the consumed contracts), 0004 (CloudEvents envelope and type catalogue) and 0005 (MCP server) are Accepted (2026-10-08). 0007 (executing an approved plan) is Superseded by 0010 (Accepted, 2026-10-14: approved plans are executed as WES relocation work, plus theStockRelocatedconsumer and the plan'sexecutionprogress). 0008 and 0009 cover the outbox attempt cap and trace context. - Fleet-level: Context Map (K25 to K27,
K29 and K38; K37 is the
inventory-storagehop in between), the Event Standard (subdomain table and type catalogue), Subdomain Classification and the Ubiquitous Language.