Behaviour and macros for Domain Events.
Domain Events represent meaningful things that happened in the domain. Named in past tense, they carry all data needed to understand the occurrence.
Usage
defmodule MyApp.Events.OrderPlaced do
use DDD.DomainEvent
domain_event do
field :order_id, :string
field :customer_id, :string
end
end
event = MyApp.Events.OrderPlaced.new(%{order_id: "123", customer_id: "c1"})
Summary
Callbacks
@callback event_name() :: String.t()