Logistiki.Accounting.Result (logistiki v0.1.0)

Copy Markdown View Source

The result of Logistiki.process/1.

Captures the end-to-end outcome of the accounting pipeline for one business event: the selected policy, the generated journal and postings, the ledger backend result, projection updates, audit evidence id, warnings, and a human- readable explanation.

Fields

  • event_idterm() | nil — the originating event id

  • policyatom() | nil — the selected accounting policy (e.g. :cash_deposit); nil for no-accounting-impact events

  • templateatom() | nil — the selected template

  • journalLogistiki.Accounting.Journal.t() | nil — the posted journal; nil for no-accounting-impact events

  • postings[Logistiki.Accounting.Posting.t()] — the journal's postings
  • ledger_resultLogistiki.Ledger.Result.t() | nil — the backend result

  • projection_updatesmap() — balance updates keyed by account code
  • audit_evidence_idterm() | nil — the event id for audit trail lookup

  • warnings[term()] — non-fatal warnings
  • explanationmap() — the full pipeline explanation (policy, template, account roles, knowledge explanation, reason)

Example

%Logistiki.Accounting.Result{
  event_id: "evt_001",
  policy: :cash_deposit,
  template: :cash_deposit,
  journal: %Logistiki.Accounting.Journal{status: "posted", ...},
  postings: [%Posting{...}, %Posting{...}],
  ledger_result: %Logistiki.Ledger.Result{backend: Logistiki.Ledger.Simulation, status: :ok},
  audit_evidence_id: "evt_001",
  warnings: [],
  explanation: %{policy: :cash_deposit, template: :cash_deposit, account_roles: %{...}}
}

No-accounting-impact result

%Logistiki.Accounting.Result{
  event_id: "evt_007",
  policy: nil,
  journal: nil,
  postings: [],
  explanation: %{reason: :no_accounting_impact}
}

Summary

Types

t()

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

Types

t()

@type t() :: %Logistiki.Accounting.Result{
  audit_evidence_id: term() | nil,
  event_id: term() | nil,
  explanation: map(),
  journal: Logistiki.Accounting.Journal.t() | nil,
  ledger_result: term() | nil,
  policy: atom() | nil,
  postings: [Logistiki.Accounting.Posting.t()],
  projection_updates: map(),
  template: atom() | nil,
  warnings: [term()]
}

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