Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

Building Block View Level 3

Level-3 view of Finance workflow coordination.

Architecture

Finance merits a deeper view because its post-checkout workflow must reconcile asynchronous basket deletion, authoritative order completion or cancellation, timeout retries, and compensating actions. Correctness depends on legal terminal-state transitions and safe recovery when a side effect succeeds but its confirmation is delayed.

Structure

The first view captures stable domain and workflow relationships; the second locates those responsibilities within Finance and its external partners.

Loading graph...

Core Elements

Class / InterfaceRole & InvariantsExtension / Modification Point
OrderWorkflow-local aggregate for basket, customer contact, total, retry count, and coordination status. Identifiers must be non-empty, the retry limit positive, and terminal states cannot transition again. Ordering remains authoritative for official order status.Route lifecycle changes through OrderLifecycleDecider; keep Finance coordination status distinct from Ordering’s business status.
OrderLifecycleDecider / OrderStatusEnforces legal state transitions, prevents duplicate basket-deletion completion, and bounds retry-driven cancellation.Add lifecycle actions and terminal-state rules here so every transition follows the same invariant checks.
OrderOrchestratorStarts placement, waits for external outcomes, delegates each outcome to a workflow step, and ends on a terminal result or exhausted retry limit.Change sequencing and timeout policy here; keep orchestration replay-safe and domain rules in the aggregate and decider.
IOrderWorkflowStep / OrderStepContextProvides the strategy boundary for handling a winning event or timer with access to the current workflow state and recovery actions. The timeout step is the fallback and must not shadow specific event handlers.Add a focused step for a new outcome and preserve dispatch precedence, especially the fallback timeout behavior.
OrderSagaCompensationsRegisters recovery actions before forward side effects and executes them in reverse order when coordination fails. A failed compensation is logged without preventing remaining actions.Pair each new reversible side effect with its recovery action; preserve completion semantics for normal, exhausted-retry, and failure paths.
Money / CustomerContactMoney rejects negative totals. Notifications are eligible only when both a customer name and email are available.Keep amount and contact eligibility rules in these value objects rather than scattering them through workflow steps.