View Source OnePiece.Commanded.Command (OnePiece.Commanded v0.15.2)

Defines "Command" modules.

Link to this section Summary

Functions

Converts the module into an Ecto.Schema.

Link to this section Types

Link to this section Functions

Link to this macro

__using__(opts \\ [])

View Source (macro)
@spec __using__(opts :: [{:aggregate_identifier, atom()}]) :: any()

Converts the module into an Ecto.Schema.

It derives from Jason.Encoder and also adds some factory functions to create structs.

usage

Usage

defmodule MyCommand do
  use OnePiece.Commanded.Command, aggregate_identifier: :id

  embedded_schema do
    # ...
  end
end