Skip to main content

Class diagrams

Two views: the domain types, and the hexagonal ports with the adapters that implement them. Go has no classes; a box is a struct or interface and the <<interface>> stereotype marks a Go interface.

Domain types​

Source: internal/domain/customerorder/{order,place,cancel,commands,status,events}.go, internal/domain/shopper/shopper.go, internal/domain/shipto/shipto.go, internal/domain/shared/shared.go. In the code Place is a package function (customerorder.Place) and Register is shopper.Register; they are drawn on their aggregate for readability.

Ports and adapters​

Source: internal/application/ports/ports.go, internal/application/usecases/*.go, internal/adapters/inbound/*, internal/adapters/outbound/*, wiring in cmd/api/main.go. cmd/mcp and cmd/a2a wire only the read use cases; outbound/memory and repocontract (an in-memory double and its shared contract test) are used by tests only and no cmd/ binary imports them.