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

Computes projections over immutable postings.

Balances are never authoritative stored state; they are derived here. The
simulation backend delegates to this engine. The Beancount backend uses
`beancount_ex` as the oracle and its results are compared against this
engine's.

## Supported projections

  * `balance/2` — leaf or parent account (aggregates descendants)
  * `balance_for_entity/2` — accounts linked to an entity
  * `balance_for_entity_tree/2` — accounts linked to an entity subtree
  * `statement/2` — running-balance statement lines
  * `trial_balance/1` — debit/credit totals per account per currency
  * `general_ledger/1` — all postings ordered
  * `balance_sheet/1`, `income_statement/1` — sectioned views

# `balance`
*since 0.1.0* 

Computes the balance(s) for `account` (a struct, id, or code). Aggregates descendants for parent accounts.

# `balance_for_entity`
*since 0.1.0* 

Computes balances for accounts linked to `entity`.

# `balance_for_entity_tree`
*since 0.1.0* 

Computes balances for accounts linked to `entity` or any of its descendants.

# `balance_sheet`
*since 0.1.0* 

Builds a balance sheet (assets, liabilities, equity).

# `general_ledger`
*since 0.1.0* 

Builds a general ledger view of all posted postings.

# `income_statement`
*since 0.1.0* 

Builds an income statement (income, expenses, net profit).

# `statement`
*since 0.1.0* 

Builds a running-balance statement for `account` (aggregates descendant postings).

# `trial_balance`
*since 0.1.0* 

Builds a trial balance across all posted journals.

---

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