# `Logistiki.Projections.Balance`
[🔗](https://github.com/thanos/logistiki/blob/v0.1.0/lib/logistiki/projections/balance.ex#L1)

A derived balance for an account (or aggregation of accounts).

Balances are never authoritative stored state. They are projections over
immutable postings. `net` is signed: positive for a debit balance, negative
for a credit balance.

# `t`

```elixir
@type t() :: %Logistiki.Projections.Balance{
  account_code: String.t() | nil,
  account_id: term() | nil,
  credit_total: Decimal.t(),
  currency: String.t(),
  debit_total: Decimal.t(),
  net: Decimal.t(),
  posting_count: non_neg_integer()
}
```

The struct type. See the module documentation for field details and examples.

# `build`
*since 0.1.0* 

Builds a balance from a row of `{debit_total, credit_total, count}` for `currency`.

# `nonzero?`
*since 0.1.0* 

True when the balance is non-zero.

---

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