Skip to main content

DDD artifact pack (ddd-crew)

This pack describes the Labor Performance bounded context with the ddd-crew modelling tools plus UML, ER and sequence diagrams. Every diagram is Mermaid, every page lists the source files it was derived from, and every page states what it leaves out.

ArtifactPageddd-crew tool / notation it follows
Core Domain ChartCore Domain ChartCore Domain Charts
Bounded Context CanvasBounded Context CanvasBounded Context Canvas v5
Context MapContext map (kept under Ecosystem, not duplicated here)Context Mapping
Aggregate Design CanvasAggregate Design CanvasAggregate Design Canvas v1.1
Domain Message FlowDomain Message FlowDomain Message Flow Modelling
EventStorming (design level)EventStormingEventStorming glossary & cheat sheet
Ubiquitous LanguageUbiquitous languageGlossary mapped to code identifiers
UML class diagramsClass diagramsUML class diagram + hexagonal ports/adapters view
ER diagramEntity-relationshipCrow's-foot ER of the final migrated schema (OLTP and analytics)
UML sequence diagramsSequence diagramsUML sequence diagrams per command use case
Domain eventsDomain eventsPublished Language catalogue (CloudEvents 1.0)

Related narrative pages: Subdomain classification and Domain vision.

The context in one paragraph​

Labor Performance is a Supporting subdomain and a downstream observer. Its only input is fulfillment-execution's com.warehouse.wes.fulfillment-execution.task.TaskCompleted CloudEvent on warehouse.fulfillment.events; its only human-driven write is POST /standards. It scores each completed task against the engineered labor standard that was active when the task finished, derives the idle gap before it, and publishes TaskPerformanceRecorded for workforce-management. It never calls a sibling context over REST or MCP — every relationship on the context map is either an event it consumes, an event it publishes, or a read another context makes into its own surfaces.

Sources of truth​

The code on develop wins over every page in this pack. The pages were derived from:

  • internal/domain/** — the three aggregates (standard.LaborStandard, performance.TaskPerformance, idleness.IdlePeriod), the shared value objects, domain errors and the three domain events (internal/domain/shared/events.go), plus the pure trend/coaching functions in internal/domain/performance/trend.go.
  • internal/application/usecases/** and internal/application/ports/{ports,errors}.go — the six use cases and the eight outbound ports.
  • internal/adapters/** — the REST routers (inbound/http/server.go, inbound/http/reports_handler.go), the idempotency middleware, the MCP tools/resources/prompts (inbound/mcp/), the Kafka consumers (inbound/kafka/consumer.go, inbound/kafka/analytics_consumer.go), the CloudEvents helper (kafka/cloudevents/cloudevents.go), the publishers, the outbox relay and the sweeper.
  • internal/analytics/report/** — the analytical read model.
  • migrations/*.up.sql and migrations/analytics/*.up.sql — the schema.
  • apis/openapi.yaml, apis/openapi-reports.yaml and apis/asyncapi.yaml — the published contracts.
  • docs/docs/adr/ — the decisions behind the shape (ADR 0001–0030).
  • For the relationships, each collaborating repository's own develop branch (paths cited on the Context map).

When a page and the code disagree, the code is right and the page is a bug.