# logistiki v0.1.0 - Table of Contents

## Pages

- [Logistiki](readme.md)
- [Logistiki v0.1.0 — End-to-End Demo](logistiki_demo.md)
- [LICENSE](license.md)
- [The accounting pipeline](accounting_pipeline.md)
- [Audit evidence](audit_evidence.md)
- [The Beancount backend](beancount_backend.md)
- [Business entities](business_entities.md)
- [Business events](business_events.md)
- [Datalog accounting policies](datalog_accounting_policies.md)
- [Demo script](demo_script.md)
- [Entity-account relationships](entity_account_relationships.md)
- [Journals and postings](journals_and_postings.md)
- [The knowledge layer](knowledge_layer.md)
- [Ledger invariants](ledger_invariants.md)
- [Projections](projections.md)
- [Testing strategy](testing_strategy.md)
- [Virtual accounts](virtual_accounts.md)
- [Vision](vision.md)

## Modules

- [Logistiki.Event.AccountOpened](Logistiki.Event.AccountOpened.md): A customer account was opened. This event has **no accounting impact**: it
produces audit evidence only.
- [Logistiki.Event.DepositReceived](Logistiki.Event.DepositReceived.md): A cash or wire deposit received into a client account.
- [Logistiki.Event.FeeAssessed](Logistiki.Event.FeeAssessed.md): A fee assessed against a client account (e.g. a wire fee).
- [Logistiki.Event.InterestAccrued](Logistiki.Event.InterestAccrued.md): Interest accrued on a client account.
- [Logistiki.Event.InvoicePaid](Logistiki.Event.InvoicePaid.md): An invoice paid by a customer from their operating account.
- [Logistiki.Event.RefundIssued](Logistiki.Event.RefundIssued.md): A refund issued to a customer. Accounting impact mirrors a withdrawal:
debit client liability, credit cash.
- [Logistiki.Event.TransferSettled](Logistiki.Event.TransferSettled.md): An internal transfer settled between two accounts (e.g. operating -> payroll).
- [Logistiki.Events.BusinessEvent](Logistiki.Events.BusinessEvent.md): Persisted record of a normalized business event.

- Public API
  - [Logistiki](Logistiki.md): Logistiki — an embedded OTP accounting engine for Elixir applications.

- Business Events
  - [Logistiki.Event](Logistiki.Event.md): Behaviour implemented by business events.
  - [Logistiki.Event.Normalized](Logistiki.Event.Normalized.md): The canonical, flattened representation of a business event.
  - [Logistiki.Events](Logistiki.Events.md): The context for business events.

- Knowledge Layer
  - [Logistiki.Knowledge](Logistiki.Knowledge.md): The context for the accounting knowledge layer.
  - [Logistiki.Knowledge.Facts](Logistiki.Knowledge.Facts.md): Generates runtime Datalog facts from a normalized business event.
  - [Logistiki.Knowledge.KnowledgeBase](Logistiki.Knowledge.KnowledgeBase.md): Loads and evaluates the accounting knowledge program for a single event.
  - [Logistiki.Knowledge.PolicySelector](Logistiki.Knowledge.PolicySelector.md): Selects the accounting policy for a normalized event using the knowledge layer.
  - [Logistiki.Knowledge.Program](Logistiki.Knowledge.Program.md): The Datalog knowledge base for Logistiki.
  - [Logistiki.Knowledge.Query](Logistiki.Knowledge.Query.md): Helpers for querying materialized `ExDatalog.Knowledge` for Logistiki facts.
  - [Logistiki.Knowledge.Result](Logistiki.Knowledge.Result.md): The outcome of evaluating the knowledge layer for a single business event.
  - [Logistiki.Knowledge.Rules](Logistiki.Knowledge.Rules.md): Documentation and helpers for the three rule categories in Logistiki.
  - [Logistiki.Knowledge.TemplateResolver](Logistiki.Knowledge.TemplateResolver.md): Resolves the posting template for a selected accounting policy.

- Accounting
  - [Logistiki.Accounting](Logistiki.Accounting.md): The context for internal accounting artifacts: journals and postings.
  - [Logistiki.Accounting.AccountingPolicy](Logistiki.Accounting.AccountingPolicy.md): A record of the accounting policy selected for an event.
  - [Logistiki.Accounting.AccountingTemplate](Logistiki.Accounting.AccountingTemplate.md): A posting template: an ordered list of posting specs that a policy resolves
into concrete postings.
  - [Logistiki.Accounting.InvariantValidator](Logistiki.Accounting.InvariantValidator.md): Enforces hard accounting invariants in deterministic Elixir.
  - [Logistiki.Accounting.Journal](Logistiki.Accounting.Journal.md): A journal is an internal accounting artifact created by the runtime from a
business event. Journals are not the main application-facing API; applications
publish business events.
  - [Logistiki.Accounting.JournalBuilder](Logistiki.Accounting.JournalBuilder.md): Builds a journal draft (and its posting changesets) from a knowledge result
and a normalized event.
  - [Logistiki.Accounting.Money](Logistiki.Accounting.Money.md): A small money helper around `Decimal` amounts and a currency string.
  - [Logistiki.Accounting.Pipeline](Logistiki.Accounting.Pipeline.md): The accounting pipeline: the defining mental model of Logistiki.
  - [Logistiki.Accounting.Posting](Logistiki.Accounting.Posting.md): A posting is a single debit or credit leg of a journal.
  - [Logistiki.Accounting.PostingBuilder](Logistiki.Accounting.PostingBuilder.md): Builds concrete postings from a posting template and resolved account roles.
  - [Logistiki.Accounting.Result](Logistiki.Accounting.Result.md): The result of `Logistiki.process/1`.

- Ledger Backends
  - [Logistiki.Ledger](Logistiki.Ledger.md): The context for ledger backends.
  - [Logistiki.Ledger.Beancount](Logistiki.Ledger.Beancount.md): The Beancount ledger backend — the accounting oracle.
  - [Logistiki.Ledger.BeancountMapper](Logistiki.Ledger.BeancountMapper.md): Maps Logistiki virtual accounts, journals, and postings to Beancount
directives and back.
  - [Logistiki.Ledger.Behaviour](Logistiki.Ledger.Behaviour.md): Behaviour implemented by ledger backends.
  - [Logistiki.Ledger.Result](Logistiki.Ledger.Result.md): The result of a ledger backend execution.
  - [Logistiki.Ledger.Simulation](Logistiki.Ledger.Simulation.md): The simulation ledger backend.

- Projections
  - [Logistiki.Projections](Logistiki.Projections.md): The context for projections.
  - [Logistiki.Projections.Balance](Logistiki.Projections.Balance.md): A derived balance for an account (or aggregation of accounts).
  - [Logistiki.Projections.BalanceSheet](Logistiki.Projections.BalanceSheet.md): A balance sheet view: assets, liabilities, and equity balances.
  - [Logistiki.Projections.GeneralLedger](Logistiki.Projections.GeneralLedger.md): A general ledger view: all postings ordered by effective date and journal.
  - [Logistiki.Projections.IncomeStatement](Logistiki.Projections.IncomeStatement.md): An income statement view: income and expense balances, plus net profit per
currency.

  - [Logistiki.Projections.ProjectionEngine](Logistiki.Projections.ProjectionEngine.md): Computes projections over immutable postings.
  - [Logistiki.Projections.StatementLine](Logistiki.Projections.StatementLine.md): A single line in an account statement.
  - [Logistiki.Projections.TrialBalance](Logistiki.Projections.TrialBalance.md): A trial balance: debit/credit totals per account per currency.

- Entities
  - [Logistiki.BusinessEntities](Logistiki.BusinessEntities.md): The context for hierarchical business entities.
  - [Logistiki.BusinessEntities.BusinessEntity](Logistiki.BusinessEntities.BusinessEntity.md): A hierarchical business entity: legal, operational, customer, organizational,
or ownership structure.
  - [Logistiki.BusinessEntities.BusinessEntityClosure](Logistiki.BusinessEntities.BusinessEntityClosure.md): Closure table for the business entity hierarchy.
  - [Logistiki.Relationships](Logistiki.Relationships.md): The context for entity-to-account relationships.
  - [Logistiki.Relationships.EntityAccount](Logistiki.Relationships.EntityAccount.md): A many-to-many relationship between a business entity and a virtual account,
with effective dating and a relationship type.
  - [Logistiki.VirtualAccounts](Logistiki.VirtualAccounts.md): The context for hierarchical virtual accounts.
  - [Logistiki.VirtualAccounts.VirtualAccount](Logistiki.VirtualAccounts.VirtualAccount.md): A hierarchical accounting account. Virtual accounts are not balances; balances
are derived from postings. Parent accounts aggregate children.
  - [Logistiki.VirtualAccounts.VirtualAccountClosure](Logistiki.VirtualAccounts.VirtualAccountClosure.md): Closure table for the virtual account hierarchy.

- Audit
  - [Logistiki.Audit](Logistiki.Audit.md): The context for audit evidence.
  - [Logistiki.Audit.AuditEvent](Logistiki.Audit.AuditEvent.md): A persisted audit event.
  - [Logistiki.Audit.Evidence](Logistiki.Audit.Evidence.md): A structured audit-evidence record.

- Infrastructure
  - [Logistiki.Demo](Logistiki.Demo.md): The end-to-end demo scenario for Logistiki v0.1.0 (project plan §35).
  - [Logistiki.Demo.Seeds](Logistiki.Demo.Seeds.md): Demo scenario seeds for Logistiki v0.1.0.
  - [Logistiki.Error](Logistiki.Error.md): Structured errors returned across the accounting pipeline.
  - [Logistiki.Repo](Logistiki.Repo.md): The Ecto repository backing Logistiki.
  - [Logistiki.Telemetry](Logistiki.Telemetry.md): Telemetry event helpers for the accounting pipeline.

