A many-to-many relationship between a business entity and a virtual account, with effective dating and a relationship type.
Fields
id—integer()— primary key (e.g.1)business_entity_id—integer()— FK tobusiness_entities(e.g.1)virtual_account_id—integer()— FK tovirtual_accounts(e.g.10)relationship_type—String.t()— one ofrelationship_types/0(e.g."owner","beneficiary")valid_from—Date.t()— when the relationship became active (e.g.~D[2026-07-07])valid_to—Date.t() | nil— when it ended;nilwhile still active (e.g.nilor~D[2026-12-31])metadata—map()— extensible key/value store (default%{}, e.g.%{"note" => "joint account"})inserted_at—DateTime.t() | nil— set by Ecto (e.g.~U[2026-07-07 12:00:00Z])updated_at—DateTime.t() | nil— set by Ecto
Associations
business_entity—belongs_toLogistiki.BusinessEntities.BusinessEntityvirtual_account—belongs_toLogistiki.VirtualAccounts.VirtualAccount
Unique constraint
The pair (business_entity_id, virtual_account_id, relationship_type) is
unique — but multiple relationship types between the same entity and
account are allowed (e.g. :owner and :beneficiary).
Example
%Logistiki.Relationships.EntityAccount{
id: 1,
business_entity_id: 1,
virtual_account_id: 10,
relationship_type: "owner",
valid_from: ~D[2026-07-07],
valid_to: nil,
metadata: %{"note" => "primary owner"}
}
Summary
Functions
Returns the list of allowed relationship types as atoms.
Types
@type t() :: %Logistiki.Relationships.EntityAccount{ __meta__: term(), business_entity: term(), business_entity_id: integer() | nil, id: integer() | nil, inserted_at: DateTime.t() | nil, metadata: map() | nil, relationship_type: String.t() | nil, updated_at: DateTime.t() | nil, valid_from: Date.t() | nil, valid_to: Date.t() | nil, virtual_account: term(), virtual_account_id: integer() | nil }
The EntityAccount struct type.
Represents a many-to-many link between a business entity and a virtual account with effective dating and a relationship type.
Fields
id—integer() | nil— primary keybusiness_entity_id—integer() | nil— FK tobusiness_entitiesvirtual_account_id—integer() | nil— FK tovirtual_accountsrelationship_type—String.t() | nil— e.g."owner","beneficiary"valid_from—Date.t() | nil— when the relationship became activevalid_to—Date.t() | nil— when it ended;nilwhile activemetadata—map() | nil— extensible metadatainserted_at—DateTime.t() | nilupdated_at—DateTime.t() | nil
Example
%Logistiki.Relationships.EntityAccount{
id: 1, business_entity_id: 1, virtual_account_id: 10,
relationship_type: "owner", valid_from: ~D[2026-07-07], valid_to: nil
}
Functions
@spec relationship_types() :: [atom(), ...]
Returns the list of allowed relationship types as atoms.
Returns
[atom()]—[:owner, :beneficiary, :controller, :signatory, :viewer, :trustee, :related_party, :manager, :custodian]
Examples
iex> :owner in Logistiki.Relationships.EntityAccount.relationship_types()
true