# `Beancount.Schemas.Commodity`
[🔗](https://github.com/thanos/beancount_ex/blob/v0.6.0/lib/beancount/schemas/directives.ex#L83)

Persisted `commodity` directive (table `beancount_commodities`).

Storage-layer counterpart of `Beancount.Directives.Commodity`.

## Fields

  * `date` - declaration date of the commodity.
  * `currency` - commodity symbol, e.g. `"USD"` or `"AAPL"`.
  * `metadata` - arbitrary key/value map (e.g. `%{"name" => "Apple Inc."}`).
  * `file_order` - zero-based position of the directive in the source.

## Example

    %Beancount.Schemas.Commodity{
      date: ~D[2026-01-01],
      currency: "AAPL",
      metadata: %{"name" => "Apple Inc."},
      file_order: 1
    }

# `t`

```elixir
@type t() :: %Beancount.Schemas.Commodity{
  __meta__: term(),
  currency: term(),
  date: term(),
  file_order: term(),
  id: term(),
  inserted_at: term(),
  metadata: term(),
  updated_at: term()
}
```

---

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