# `Datumo.Event`
[🔗](https://github.com/ortegacmanuel/datumo/blob/v0.1.0/lib/datumo/event.ex#L1)

A domain event, declared on its struct:

    @derive {Datumo.Event,
             type: "PlotRegistered",
             tags: [:plot_id, :owner_id, region: [:address, "regionId"]]}
    defstruct [:plot_id, :owner_id, :address, :registered_at]

* `type` is the event's title on the board, verbatim. It is what the store
  keeps and what other slices match on, so it never comes from the module
  name: renaming a module must not rename a fact.
* `tags` are the board's fields with `idAttribute: true` or `tag: true`.
  `:plot_id` gives `"plot:<value>"`. A subfield goes by its path:
  `region: [:address, "regionId"]` gives `"region:<value>"`. Through a list,
  one tag per element: `lot: [:lots, :lot_id]`. A nil value gives no tag.

`to_event/1` returns `%{type:, data:, tags:}`, the shape FACT and UmaDB both
store.

# `t`

```elixir
@type t() :: term()
```

All the types that implement this protocol.

# `to_event`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
