Beancount.Schemas.Balance (beancount_ex v0.6.0)

Copy Markdown View Source

Persisted balance assertion (table beancount_balances).

Storage-layer counterpart of Beancount.Directives.Balance.

Fields

  • date - the day the assertion is checked (start of day).
  • account - account whose balance is asserted.
  • amount - expected balance as Decimal.t().
  • currency - commodity of the expected balance.
  • tolerance - optional Decimal.t() tolerance (± amount), or nil.
  • metadata - arbitrary key/value map.
  • file_order - zero-based position of the directive in the source.

Example

%Beancount.Schemas.Balance{
  date: ~D[2026-06-01],
  account: "Assets:Bank",
  amount: Decimal.new("100"),
  currency: "USD",
  tolerance: nil,
  metadata: %{},
  file_order: 8
}

Summary

Types

t()

@type t() :: %Beancount.Schemas.Balance{
  __meta__: term(),
  account: term(),
  amount: term(),
  currency: term(),
  date: term(),
  file_order: term(),
  id: term(),
  inserted_at: term(),
  metadata: term(),
  tolerance: term(),
  updated_at: term()
}