Skip to main content

EventStorming

Process-level boards in the ddd-crew EventStorming notation. Every sticky comes from the code. Neighbour events are orange stickies prefixed with the producer (OS order-sourcing, ST shipping-and-tracking, CK checkout).

ColourSticky
Pale yellowActor
BlueCommand
YellowAggregate
OrangeDomain event
LilacPolicy
GreenRead model
PinkExternal system

1. Authorize at checkout​

Source: internal/application/usecases/authorization.go, internal/domain/paymentauthorization/events.go.

2. Bind the order and apply parked facts​

Source: internal/application/usecases/consume.go, facts.go (replayParked), policies.go (MaintainParkedFacts), internal/application/parked.

3. Capture and release​

Source: internal/application/usecases/facts.go (captureGroup, releaseGroup, shrinkHold), internal/domain/paymentauthorization/commands.go.

4. Refunds​

Source: internal/application/usecases/refund.go, facts.go (refundPackage), internal/domain/refund/refund.go.

5. Clock policies​

Source: cmd/api/policies.go (policyRunners), internal/application/usecases/policies.go, refund.go (ProcessRequestedRefunds).

Hotspots​

The model's twelve hotspots (H1 to H12) are resolved in the code; what remains open:

#HotspotEvidence
1No consumer of the eight events. All are analytics-only by contract; nobody reacts.apis/asyncapi.yaml; Integration
2No alerting on payments.authorizations.decided, parked facts, unpublished outbox rows or a failed refund; only ERROR log lines (ALERT refund failed for good, ALERT fact for an unbound order dead-lettered).Observability
3A fact for a tracking number no capture carries is parked until 24 h, then escalated; a lost package whose shipment fact never arrived is never refunded automatically.facts.go (refundPackage), policies.go
4OpenAPI drift: the authorization state RELEASED is not in apis/openapi.yaml (the 200 replay is).API overview
5Expiry without re-authorization: a provider outage longer than the 24 h lead lets a hold lapse; the next pass expires the authorization without asking the provider.policies.go (renew)