commanded v0.4.0 Commanded.Commands.Handler behaviour
Summary
Callbacks
Apply the given command to the event-sourced aggregate root
Types
Callbacks
Specs
handle(aggregate_root, command) ::
{:ok, aggregate_root} |
{:error, reason}
Apply the given command to the event-sourced aggregate root.
You must return {:ok, aggregate}
with the updated aggregate root on success. This is the struct containing the aggregate's uuid, pending events, and current version.
You should return {:error, reason}
on failure.