AggregateDecider

Domain policy that decides whether a command is accepted and which events it proposes. Decisions should be deterministic and free of externally visible side effects.

Type Parameters

STATE

The type of the aggregate's state.

COMMAND

The base type of commands it handles.

EVENT

The base type of events it produces.

Functions

Link copied to clipboard
abstract suspend fun decideExisting(currentState: STATE, command: COMMAND): EventDecision<EVENT>

Subsequent decisions have a preceding STATE and might result in no additional EVENTs

Link copied to clipboard
abstract suspend fun decideFirst(command: COMMAND): FirstEventDecision<EVENT>

Decides creation without preceding state; acceptance must produce at least one event.