The outcome of evaluating the knowledge layer for a single business event.
Captures the business-rule decisions, the selected accounting policy, the resolved posting template, the resolved account roles, and the required dimensions. The runtime turns this into a journal draft.
Fields
event_id—term() | nil— the originating event idblocked—boolean()—truewhen a business rule blocked the eventrequires_approval—boolean()—truewhen approval is requiredpolicy—atom() | nil— the selected accounting policy (e.g.:cash_deposit)template—atom() | nil— the selected template (= the policy in v0.1.0)template_postings—[map()]— ordered posting specs, each with:sequence,:direction,:role,:amount_var,:currency_varaccount_roles—%{atom() => String.t()}— resolved role-to-code mappings (e.g.%{cash_account: "ASSETS:CASH:USD:NOSTRO", ...})required_dimensions—[atom()]— e.g.[:entity_id, :currency, :account_code]explanation—map()— why the policy was selected / blocked
Example
%Logistiki.Knowledge.Result{
event_id: "evt_001",
blocked: false,
requires_approval: false,
policy: :cash_deposit,
template: :cash_deposit,
template_postings: [
%{sequence: 1, direction: :debit, role: :cash_account, ...},
%{sequence: 2, direction: :credit, role: :client_liability_account, ...}
],
account_roles: %{
cash_account: "ASSETS:CASH:USD:NOSTRO",
client_liability_account: "LIABILITIES:CLIENT_DEPOSITS:USD:ACME:OPERATING"
},
required_dimensions: [:entity_id, :currency, :account_code],
explanation: %{reason: :unique, selected: :cash_deposit}
}
Summary
Types
@type t() :: %Logistiki.Knowledge.Result{ account_roles: %{required(atom()) => String.t()}, blocked: boolean(), event_id: term(), explanation: map(), policy: atom() | nil, required_dimensions: [atom()], requires_approval: boolean(), template: atom() | nil, template_postings: [map()] }
The struct type. See the module documentation for field details and examples.