Skip to main content

EventStorming (design level)

Synced from product-master

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

Notation from the ddd-crew EventStorming glossary and cheat sheet. Two live processes and the record of the finished migration, each read left to right. Hotspots are real, documented gaps (ADRs, code comments), not invented ones.

Legend​

Source: ddd-crew cheat-sheet colours as specified for the fleet. Omits: nothing; this is the key for the three diagrams below.

1. Register and classify a SKU​

Source: internal/application/usecases/register_product.go, classify_product.go, writer.go, internal/domain/product/product.go, internal/adapters/outbound/kafka/encoder.go; ADR 0001 (Consequences: eventual consistency). Omits: the rejection paths (400 slugs, 404 product-not-found) and the consumers' own policies. ProductClassified is consumed by the first five externals, ProductRegistered by inbound-receiving only, and ProductDescriptionChanged by nobody.

2. Declare and measure the physical profile​

Source: internal/application/usecases/physical_profile.go, internal/domain/product/physical.go, ADR 0002 (Consequences); slotting-optimization internal/adapters/inbound/kafka/product_consumer.go. Omits: ErrStaleMeasurement and ErrMeasuredAtInFuture (see the sequence diagrams).

3. Import legacy classifications (migration record, removed at stage E)​

Source: ADR 0003 (stages A, B, E and Consequences). The importer and ImportLegacyClassification were removed at stage E (2026-10-17), and inventory-storage no longer publishes the legacy type: nothing in this diagram runs today. The legacy-import hotspot is still real for the rows the importer wrote (SourceLegacyImport in internal/domain/product/classification.go). Omits: the processed-event claim and the retry loop of the former importer.

Sticky inventory​

StickyKindCode evidence
Master-data steward, dimensioning device, operatorActorREST callers of internal/adapters/inbound/http/handlers.go
RegisterProduct, ClassifyProduct, DeclareDimensions, RecordMeasurementCommandinternal/application/usecases/*.go
ProductAggregateinternal/domain/product/product.go
ProductRegistered, ProductDescriptionChanged, ProductClassified, ProductDimensionsDeclared, ProductMeasuredDomain event (published)internal/domain/product/events.go, internal/adapters/outbound/kafka/encoder.go
Publish every accepted change through the outboxPolicyWriter.persist in writer.go, outbox.Relay
Product, classification, physical profile, product listRead modelGetProduct, ListProducts in queries.go
inventory-storage, order-management, wes-work-planning, fulfillment-execution, slotting-optimization, inbound-receivingExternal systemtheir consumers of warehouse.product-master.events on develop
Late classification before first stowHotspotADR 0001, Consequences
No unclassifyHotspotProduct has no method that removes a classification, and ADR 0004 lists no such event
Physical profile used by slotting-optimization onlyHotspotADR 0002, Consequences ("later phases"): no sibling consumes it for package weight, stow volume or cube capacity
Fixed 10 % tolerance, no measurement historyHotspotADR 0002 rule 6 and Consequences
legacy-import rows never reviewedHotspotADR 0003, Consequences; SourceLegacyImport stays a valid stored value