Skip to main content

Class diagram

UML class diagrams drawn from internal/domain/** and internal/application/ports/. Names are the real Go identifiers; fields are the unexported struct fields (shown private, -), methods are the state-changing ones and key queries (public, +). Go has no classes or enums: an <<Enumeration>> is a named string type with a const block, and a <<Repository>> is a port interface.

1. Aggregates, entities and value objects​

Source: internal/domain/task/task.go, internal/domain/station/station.go, internal/domain/package/package.go, internal/domain/consolidation/order_consolidation.go, internal/domain/shared/{ids,capability,cpt}.go. The two Go types named Status are shown as TaskStatus and PackageStatus, and task.Type as TaskType, to keep the names unique in one diagram. Omits constructors (New, Rehydrate, RehydrateWithLocation), plain getters, and the segregation matrix in segregation.go (IsSegregationIncompatible). Aggregates reference each other by id only — Package.taskId, Lease.StationId — never by object; no aggregate holds another.

2. Domain events and configuration types​

Source: internal/domain/shared/events.go, internal/domain/pathcatalog/path_definition.go. Every event embeds an unexported base struct (Name, At) that implements DomainEvent; it is drawn as interface realization. Omits the New... constructors.

3. Hexagonal view: ports and adapters​

Source: internal/application/ports/ports.go, ports/equipment.go, internal/adapters/**, cmd/execution/main.go, internal/composition/publisher.go. Omits Clock and Metrics ports (implemented by memory clock and internal/observability), the MCP adapter's narrow TaskQueries read port, the analytics side (inbound/kafka/analytics_consumer.go, outbound/analyticsstore), and the idempotency and readiness middleware. The dependency direction is enforced by arch-go in internal/architecture/ (make arch-test).