Skip to main content

Class diagram

UML class diagrams of internal/domain/**, split in three so each stays readable: the aggregates with their value objects, the domain events, and the hexagonal ports with their adapters. Field and method names are the real Go identifiers; unexported fields keep their lower-case names.

Aggregates and value objects​

Source: internal/domain/shiftplan/shift_plan.go, internal/domain/associate/associate_shift.go, internal/domain/assignment/labor_assignment.go, internal/domain/shared/ids.go, internal/domain/pathcatalog/path_definition.go. Omits: getters that only expose a field (ShiftId, AssociateId, Version, IsOnBreak, HoursLogged, Ended, Certifications, ActiveInterval, History), every Rehydrate / RehydrateAtSite constructor, the private record/closeActive helpers, the New* validating constructors of the string value objects, and the free function shiftplan.ProposedHeads(charge, plannedRate). Catalogue is marked <<Entity>> for want of a better stereotype: it is reference data with no identity of its own. There are no enumerations: no aggregate has a status enum. The three roots reference each other only by AssociateId / PathId values, never by object reference. ShiftPlan.SiteCode() is the canonical accessor of the plan key; BuildingId() is its deprecated alias returning the same value (ADR 0035).

Domain events​

Source: internal/domain/shared/events.go. Omits: the embedded baseEvent struct that carries occurredAt, and the New* constructors. ShiftPlanProposed and PathUnderstaffed are constructed by use cases, not aggregates.

Ports and adapters​

Source: internal/application/ports/ports.go, internal/adapters/outbound/**, internal/composition/*.go, cmd/workforce/main.go. Omits: the inbound side (shown below), the circuit-breaker decorators that wrap the two HTTP clients, and the in-memory test doubles of the other two repos and of ProcessedEvents.

Source: cmd/*/main.go, internal/adapters/**. Omits: telemetry, clock, bootretry and resilience packages. The analytics side (KC, REP, analyticsstore) bypasses the use cases: it is a read-side projection, not part of the domain model (ADR 0010). The dependency rule is enforced by make arch-test (ADR 0007).