pagantis_elixir_tools v0.19.1 ElixirTools.Events.Event

A structure for working with events. event_id_seed is used for event_id generation(UUID5) together with name & version. So if all values are the same event will be updated.

Link to this section Summary

Link to this section Types

Link to this type

t()

t() :: %ElixirTools.Events.Event{
  event_id_seed: Ecto.UUID.t(),
  event_id_seed_optional: String.t(),
  name: String.t(),
  occurred_at: DateTime.t() | nil,
  payload: map(),
  version: String.t()
}

Link to this section Functions

Link to this function

publish(event, opts \\ [])

publish(t(), [publish_opts()]) :: return()
Link to this function

validate(event)

validate(t()) :: return()
Link to this function

validate_json_schema(schema, event)

validate_json_schema(event_schema(), t()) :: :ok | {:error, String.t()}