# `Beancount.Directives.Event`
[🔗](https://github.com/thanos/beancount_ex/blob/v0.6.0/lib/beancount/directives/event.ex#L1)

The `event` directive tracks the value of a named variable over time.

See [Events](https://beancount.github.io/docs/beancount_language_syntax/#events).

## Beancount syntax

    2026-01-01 event "location" "New York"

General form: `YYYY-MM-DD event "Type" "Description"`

## Elixir struct

    %Beancount.Directives.Event{
      date: ~D[2026-01-01],
      type: "location",
      description: "New York",
      metadata: %{}
    }

Or use `Beancount.event/4`:

    Beancount.event(~D[2026-01-01], "location", "New York")

## Fields

  * `date` - `Date.t()` the event occurred.
  * `type` - event category name (e.g. `"location"`, `"employer"`).
  * `description` - new value or label for the event type.
  * `metadata` - optional map rendered below the directive.

# `t`

```elixir
@type t() :: %Beancount.Directives.Event{
  date: Date.t(),
  description: String.t(),
  metadata: map(),
  type: String.t()
}
```

---

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