Skip to main content

DDD artifacts (ddd-crew)

DockAppointment moved (ADR 0019)

The dock appointment is owned by dock-scheduling since ADR 0019. This context keeps a read-only local copy fed by dock-scheduling's DockAppointmentBooked / DockAppointmentCancelled, no longer books, checks in, cancels or completes appointments, and no longer raises the four DockAppointment* events (the one-shot api republish-appointments backfill that re-announced them was removed, ADR 0022). Where this page describes those commands, rules or events, read it as the pre-transfer design; the page is not yet rewritten.

The strategic and tactical design of inbound-receiving, drawn with the ddd-crew tools plus UML and ER diagrams. Every diagram is Mermaid, derived from the code on develop, and carries a "Source:" line naming the files it came from.

Artifactddd-crew tool / notationWhat it shows
Core domain chartCore Domain ChartsWhere this context sits on business differentiation vs model complexity, and why it is Supporting.
Bounded context canvasBounded Context Canvas v5Purpose, classification, roles, every inbound and outbound message, business decisions.
Context mapContext MappingThis context's slice of the fleet map: upstream/downstream, patterns and technology per edge (Kafka, MCP, the console remote), every edge built.
Aggregate design canvasAggregate Design Canvas v1.1Asn, DockAppointment, Receipt: states, invariants, commands, events, size.
Domain message flowDomain Message Flow ModellingKey business scenarios as numbered command / event / query flows across contexts.
EventStormingEventStorming glossary and cheat sheetDesign-level process flows with the sticky-note colours, plus hotspots.
Ubiquitous languageGlossaryEvery term with the code identifier that implements it.
Class diagramsUML class diagramDomain types, and the hexagonal ports with their adapters.
Entity-relationship diagramER diagramThe final OLTP schema and which tables back which aggregate.
Sequence diagramsUML sequence diagramRegister, book, open, receive, close and the local-copy consumers, with error branches.
Domain eventsEvent catalogueEvery event published and consumed: full CloudEvents type, topic, key, payload, producer, consumers.

Related pages outside the pack: Use cases, Aggregates, Receiving workflow, Downstream consumers, Upstream contracts and the event catalogue.

Sources of truth

The code wins. Domain rules come from internal/domain/{asn,appointment,receipt}, the use cases from internal/application/usecases, the wiring from cmd/api/main.go, the schema from internal/adapters/outbound/postgres/migrations/*.up.sql, the REST contract from apis/openapi.yaml, the event contract from apis/asyncapi.yaml and the encoder in internal/adapters/outbound/kafka/encoder.go, and decisions from the ADRs in docs/adr/. Where a page and the code disagree, the page is wrong.

:::info Not in this pack The pack models the OLTP domain. The read-only MCP server (ADR 0005), the analytics read side (ADR 0006) and the web/ remote inbound_mfe add no aggregate and raise no event, so they have no dedicated artifact here; they appear as edges and messages on the canvas and context map and are described on Runtime. The ER diagram covers the OLTP schema only, not the analytical database (analytics/migrations/0001_receiving_performance.up.sql). :::