OnePiece.Commanded.Event (OnePiece.Commanded v0.4.1) View Source

Defines a module as a "Event" in terms of Event Sourcing context. For more information about Event Sourcing, please read the following:

Link to this section Summary

Functions

Converts the module into an Ecto.Schema, and derive from Jason.Encoder.

Link to this section Types

Link to this section Functions

Link to this macro

__using__(opts \\ [])

View Source (macro)

Specs

__using__(opts :: [{:aggregate_identifier, atom()}]) :: any()

Converts the module into an Ecto.Schema, and derive from Jason.Encoder.

Usage

defmodule MyEvent do
  use OnePiece.Commanded.Event, aggregate_identifier: :id

  embedded_schema do
    # ...
  end
end