DoubleEntryLedger.JournalEventTransactionLink (double_entry_ledger v0.1.0)

View Source

Join schema linking events and transactions in the Double Entry Ledger.

This schema records the relationship between events (business intents) and transactions (ledger entries) to provide a complete audit trail. Each link represents that a specific event was involved in creating or updating a transaction.

Fields

  • :transaction_id - References the associated transaction.
  • :inserted_at - Timestamp when the link was created.
  • :updated_at - Timestamp when the link was last updated.

Usage

Use this schema to query all events that affected a transaction, or all transactions that were affected by a specific event. This enables safe pruning of processing state while preserving the full business and audit history.

Summary

Types

t()

@type t() :: %DoubleEntryLedger.JournalEventTransactionLink{
  __meta__: term(),
  id: Ecto.UUID.t() | nil,
  inserted_at: DateTime.t() | nil,
  journal_event: DoubleEntryLedger.Command.t() | Ecto.Association.NotLoaded.t(),
  journal_event_id: Ecto.UUID.t() | nil,
  transaction:
    DoubleEntryLedger.Transaction.t() | Ecto.Association.NotLoaded.t(),
  transaction_id: Ecto.UUID.t() | nil,
  updated_at: DateTime.t() | nil
}

Functions

changeset(event_transaction_link, attrs)

@spec changeset(t(), map()) :: Ecto.Changeset.t()