View Source Domainex.Event.Structure (domainex v0.1.0)

Event.Structure used to grouping all necessary properties for the domain event, which including:

  • name
  • payload
  • timestamp

By using this structure we can simplify our base type spec for event, it will become like this:

    {:event, Event.Structure.t()}

Compare with previous implementation

    {:event, {event_name(), event_payload()}}

It become more simpler

Summary

Types

@type t() :: %Domainex.Event.Structure{
  name: Domainex.event_name(),
  payload: Domainex.event_payload(),
  timestamp: DateTime.t()
}