Logistiki.VirtualAccounts.VirtualAccountClosure (logistiki v0.1.0)

Copy Markdown View Source

Closure table for the virtual account hierarchy.

Each row records that ancestor is an ancestor of descendant at depth. A self-row has depth 0. The closure table is maintained by Logistiki.VirtualAccounts on insert and move.

Fields

  • idinteger() — primary key (e.g. 1)
  • ancestor_idinteger() — the ancestor account id (e.g. 1 for ASSETS)
  • descendant_idinteger() — the descendant account id (e.g. 4 for ASSETS:CASH:USD:NOSTRO)
  • depthinteger() — 0 for self, 1 for direct child, 2 for grandchild (e.g. 3)
  • inserted_atDateTime.t() | nil — set on insert (no updated_at; e.g. ~U[2026-07-07 12:00:00Z])

Example

%Logistiki.VirtualAccounts.VirtualAccountClosure{
  id: 1,
  ancestor_id: 1,    # ASSETS
  descendant_id: 4,  # ASSETS:CASH:USD:NOSTRO
  depth: 3,
  inserted_at: ~U[2026-07-07 12:00:00Z]
}

Summary

Types

t()

The VirtualAccountClosure struct type.

Types

t()

@type t() :: %Logistiki.VirtualAccounts.VirtualAccountClosure{
  __meta__: term(),
  ancestor_id: integer() | nil,
  depth: integer() | nil,
  descendant_id: integer() | nil,
  id: integer() | nil,
  inserted_at: DateTime.t() | nil
}

The VirtualAccountClosure struct type.

A row in the closure table recording that ancestor_id is an ancestor of descendant_id at the given depth.

Fields

  • idinteger() | nil — primary key

  • ancestor_idinteger() | nil — ancestor account id (e.g. 1)

  • descendant_idinteger() | nil — descendant account id (e.g. 4)

  • depthinteger() | nil — 0 for self, 1 for child, 2 for grandchild

  • inserted_atDateTime.t() | nil — set on insert (no updated_at)

Example

%Logistiki.VirtualAccounts.VirtualAccountClosure{
  ancestor_id: 1, descendant_id: 4, depth: 3
}