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

An aggregate objects may using this structure as their base data structure, although the function implementation it will always depends to some specific requirements and logics.

This structure provides only four possible keys, which are:

  • :name
  • :contains
  • :events
  • :processors

An aggregate may contains a single entity object or a group of entities. An aggregate also should responsible to emit an event for each domain activities

Specific for :processor, it must be a module which implement behaviour Event.Processor

Summary

Types

@type t() :: %Domainex.Aggregate.Structure{
  contains:
    Domainex.aggregate_payload()
    | %{required(atom()) => Domainex.aggregate_payload()},
  events: [Domainex.event()],
  name: Domainex.aggregate_name(),
  processors: [module()]
}