Skip to main content

DDD Artifacts

The Domain-Driven Design artifact pack for Inventory & Storage, following the ddd-crew tools plus UML. Every diagram is Mermaid, derived from the code on develop, and carries a "Source:" line naming the files it came from and a note on what it omits.

Strategic design​

Artifactddd-crew toolWhat it answers
Subdomain Classification— (reference model)Why this is a Core subdomain in the WMS tier.
Core Domain ChartCore Domain ChartsDifferentiation vs model complexity, with the evolution note.
Bounded Context CanvasBounded Context Canvas v5Purpose, roles, every inbound and outbound message, decisions, open questions.
Context MapContext MappingEvery upstream/downstream relationship, pattern, technology and wiring status.
Context Relationships— (narrative)The strategic story behind each edge of the map.
Ubiquitous Language— (glossary)Every term with its code identifier, and where the two differ.

Tactical design​

Artifactddd-crew toolWhat it answers
Aggregate Design CanvasAggregate Design Canvas v1.1One canvas per aggregate root: states, invariants with their Err values, commands, events, throughput, size.
Domain Events— (event catalogue)Every event published and consumed: full CloudEvents type, topic, key, payload, producer, consumers.
Domain Message FlowDomain Message Flow ModellingFour business scenarios as numbered command / query / event flows between contexts.
EventStormingEventStorming glossary and cheat sheetDesign-level process maps with the standard sticky colours and real hotspots.
Use Cases—The application use cases, their collaborators and algorithms.

UML and data​

ArtifactNotationWhat it answers
Class DiagramsUML class diagramDomain types, enumerations, events, ports and the hexagonal adapter map.
ER DiagramEntity-relationshipThe final OLTP and analytical Postgres schemas and the table-to-aggregate mapping.
Sequence DiagramsUML sequence diagramEvery command use case plus the outbox relay and both Kafka consumers, following the function bodies.
Sources of truth

Code wins over every page here. The facts come from:

  • internal/domain/** — aggregates, value objects, invariants, events.
  • internal/application/usecases/** and ports/ports.go — use cases and ports.
  • internal/adapters/** and cmd/*/main.go — routes, MCP tools, topics, consumer groups, environment variables and wiring.
  • migrations/*.up.sql and migrations/analytics/*.up.sql — the schema.
  • apis/openapi.yaml and apis/asyncapi.yaml — the published contracts (pinned to the code by the contract and arch-test CI jobs).
  • docs/docs/adr/ — the decisions (ADR 0001-0029).
  • Sibling repositories' outbound adapters on develop — for who calls this service and how (see the Context Map).

Throughput and size figures on the Aggregate Design Canvas, and the coordinates on the Core Domain Chart, are estimates and are labelled so.