evoq_event behaviour (evoq v1.14.1)
View SourceEvent behavior for evoq.
Events represent facts that have happened. They are: - Past tense: account_opened, money_deposited - Immutable once stored - Produced by aggregates in response to commands - Domain artifacts: atom keys, Erlang terms, stay inside bounded context
Required Callbacks
- event_type() -> atom() - new(Params) -> Event - to_map(Event) -> map()
Optional Callbacks
- from_map(Map) -> {ok, Event} | {error, Reason}