Skip to main content

Context map

Synced from slotting-optimization

This page is a copy of docs/docs/ddd/context-map.md on develop, derived from that repository's code. Edit it there, then re-sync.

This context's slice of the fleet context map, following ddd-crew Context Mapping. U = upstream, D = downstream. Solid edges exist in code on develop; dashed edges are planned.

Source: internal/adapters/inbound/kafka/consumer.go (topics), internal/adapters/outbound/kafka/encoder.go, docs/adr/0001-slotting-optimization-bounded-context.md (context map), docs/adr/0003-local-copies-and-consumed-contracts.md, docs/adr/0010-approved-slot-plans-are-executed-as-wes-relocation-work.md.

Edges​

EdgePatternTechnologyContractState
order-management -> slotting-optimizationPublished Language / Conformist, local demand copyKafka warehouse.order-management.events, group DEMAND_CONSUMER_GROUPSiteSkuDemandChanged v1built (DEMAND_MODE=kafka)
product-master -> slotting-optimizationPublished Language / Conformist, local product copyKafka warehouse.product-master.events, group PRODUCT_CONSUMER_GROUPProductClassified, ProductDimensionsDeclared, ProductMeasured v1built (PRODUCT_MODE=kafka)
facility-layout -> slotting-optimizationOpen Host Service + Published Language / Conformist, local slot copyKafka warehouse.facility.events, group LAYOUT_CONSUMER_GROUPZoneRegistered, LocationSlotRegistered, LocationSlotDecommissioned v1built (LAYOUT_MODE=kafka)
slotting-optimization -> warehouse-ops-agentOpen Host ServiceMCP read tools (cmd/mcp, Kong /api/mcp/slotting-optimization)list_slot_plans, get_slot_plan (the agent's slot-plan watch, its ADR 0024)live: MCP enabled in warehouse-infra and the agent's SLOTTING_OPTIMIZATION_MCP_ENDPOINT set
slotting-optimization -> console web remoteOpen Host ServiceREST (apis/openapi.yaml) through Kong /api/slotting-optimizationthe seven REST operationsremote slotting_mfe built and packaged (web/Dockerfile); wired-but-unused: no frontend_remote in warehouse-infra terraform/apps.yaml, so no image or gateway route
slotting-optimization -> wes-work-planning (-> fulfillment-execution -> inventory-storage)Published Language / ConformistKafka warehouse.slotting-optimization.events; RELOCATE work on the process-path-management RELOCATE path (intake SLOT_RELOCATION)SlotPlanApproved v1 (moves)built in the siblings (wes-work-planning ADR 0040, fulfillment-execution ADR 0047, inventory-storage ADR 0039, process-path-management ADR 0033/0034); decided by ADR 0010
inventory-storage -> slotting-optimizationPublished Language / Conformist, execution-progress read modelKafka warehouse.inventory.events, group RELOCATION_CONSUMER_GROUPStockRelocated v1built (RELOCATION_MODE=kafka, ADR 0010)

Why Conformist upstream​

The four producers own facts this context only reads (demand, product facts, slot facts, executed relocations). Restating their payloads in local structs (siteSkuDemandChangedData, productClassifiedData, physicalProfileData, zoneRegisteredData, locationSlotRegisteredData, locationSlotDecommissionedData) and acting only on the fields it needs is cheaper than an anti-corruption layer, and the copies keep the planner working when a producer is down. The price: a breaking change upstream breaks the copy, which is why ADR 0003 pins the consumed contracts in apis/asyncapi.yaml.

No live lookup, in either direction​

This context has no outbound HTTP or MCP client, and no sibling calls it at request time (ADR 0001). Siblings learn about plans only from warehouse.slotting-optimization.events.

Explicit non-edges​

No command edge to inventory-storage: this context never moves stock or changes stow; it only reads StockRelocated (ADR 0010). No edge to inbound-receiving or warehouse-planning (ADR 0001).