Class diagram
Synced from exception-management
This page is a copy of docs/docs/ddd/class-diagram.md on develop, derived from that repository's code. Edit it there, then re-sync.
The domain model exactly as it exists in internal/domain (field and
method names taken from the code; pure Go, no I/O).
Facts worth knowing that the diagram cannot show:
OpenandOpenOrTouchare package functions ofexceptioncase(they validate the input and build the aggregate); everything after open is a method on*Case.Statusis a string type:OPEN | TRIAGED | ASSIGNED | RESOLVED;ESCALATEDis the boolescalatedflag, set once byEscalate(the sweeper), never a status value.resolutionandautoResolutionare unexported value types; the published evidence surfaces through the getters (ResolutionCode,RootCause,Note,ResolvedAt,AutoResolution) and theexceptioncase.Snapshot.Rule.ID(sourceType)derives the deterministic rule id<sourceType>-><onType>recorded on auto-resolved cases.Matchcarries everything the pure matcher needs — the correlated fact's type and order id, the case's frozen sourceorder_ref, the last occurrence instant andnow— so the domain reads no clocks.- The domain events (
ExceptionOpened… in each aggregate'sevents.go) are plain structs withOccurredAt(); they know nothing of CloudEvents or Kafka — the outbound adapter maps them (ADR 0004). - Repositories persist and restore through the immutable
Snapshot(exceptioncase/snapshot.go;Restorevalidates, so a corrupt row can never become a live aggregate); the views DTO (internal/application/views) is what inbound adapters see. shared.ID(case ids,case-<uuid>fromsystem.CaseIDsat open),shared.DedupKey,shared.Actorandshared.ParseWorkUnitRef(the{order_id}-line-{line_no}reversal) are the shared value objects.