Skip to main content

Event catalogue

Every Kafka message this service produces or consumes is a CloudEvents 1.0 event in structured mode: the Kafka value is the whole JSON envelope and the header content-type is application/cloudevents+json; charset=UTF-8. Published messages may also carry the optional W3C traceparent header of the request that wrote them (ADR 0009). Envelopes are built and decoded only in internal/adapters/kafka/cloudevents (ADR 0004). The contract is apis/asyncapi.yaml; field-level detail is on Domain events.

Published​

Topic warehouse.slotting-optimization.events, source /warehouse/slotting-optimization, subject and Kafka key = the plan id, dataschema urn:warehouse:slotting-optimization:events:<EventName>:v1.

TypeRaised bydata
com.warehouse.wms.slotting-optimization.slotplan.SlotPlanGeneratedPOST /slot-plansplan_id, site_id, window_from, window_to, policy, assignment_count, move_count, unassigned_count
com.warehouse.wms.slotting-optimization.slotplan.SlotPlanApprovedPOST /slot-plans/{planId}/approvalsplan_id, site_id, approved_at, supersedes_plan_id?, assignments[{sku, slot}], moves[{sku, from_slot?, to_slot?, kind}]
com.warehouse.wms.slotting-optimization.slotplan.SlotPlanRejectedPOST /slot-plans/{planId}/rejectionsplan_id, site_id, rejected_at, reason?

Superseding the previous Approved plan raises no event of its own: it is carried by supersedes_plan_id on the new SlotPlanApproved.

Consumers of this integration topic on origin/develop of the siblings: wes-work-planning (SlotPlanApproved: one RELOCATE work unit per move, its ADR-0040), inventory-storage (SlotPlanApproved: its forward-face read model, internal/adapters/inbound/kafka/slot_plan_consumer.go, its ADR 0050) and pick-face-replenishment (SlotPlanApproved: its local forward-assignment map, internal/adapters/inbound/kafka/slotting_consumer.go). No sibling consumes SlotPlanGenerated or SlotPlanRejected.

Analytics stream​

Topic warehouse.slotting-optimization.analytics (ADR 0006) carries the same three types with the same CloudEvents id, type, source, subject and key, and a byte-identical data; only the dataschema differs (urn:warehouse:slotting-optimization:analytics:<EventName>:v1). cmd/api writes both rows in one transaction (FanoutEncoder, integration row first). It is not an integration contract: the only consumer is this repository's cmd/slotting-projector (group ANALYTICS_CONSUMER_GROUP, default slotting-optimization-analytics), whose poison messages go to warehouse.slotting-optimization.analytics.dlq.

Consumed​

TypeTopicConsumer
com.warehouse.wes.order-management.siteskudemand.SiteSkuDemandChangedwarehouse.order-management.eventsdemand consumer (DEMAND_MODE)
com.warehouse.wms.product-master.product.ProductClassifiedwarehouse.product-master.eventsproduct consumer (PRODUCT_MODE)
com.warehouse.wms.product-master.product.ProductDimensionsDeclaredwarehouse.product-master.eventsproduct consumer
com.warehouse.wms.product-master.product.ProductMeasuredwarehouse.product-master.eventsproduct consumer
com.warehouse.wms.facility-layout.zone.ZoneRegisteredwarehouse.facility.eventslayout consumer (LAYOUT_MODE)
com.warehouse.wms.facility-layout.locationslot.LocationSlotRegisteredwarehouse.facility.eventslayout consumer
com.warehouse.wms.facility-layout.locationslot.LocationSlotDecommissionedwarehouse.facility.eventslayout consumer
com.warehouse.wms.inventory-storage.stock.StockRelocatedwarehouse.inventory.eventsrelocation consumer (RELOCATION_MODE): slot-plan execution progress (ADR 0010)
com.warehouse.wms.slotting-optimization.slotplan.SlotPlanGenerated, ...SlotPlanApproved, ...SlotPlanRejectedwarehouse.slotting-optimization.analyticscmd/slotting-projector (analytics read side, ADR 0006)

Dead-letter topics: <topic>.dlq for each consumed topic, including warehouse.slotting-optimization.analytics.dlq (Runbook). A malformed StockRelocated goes there at once; a relocation of no known move does not.