CFONB.Operation (CFONB v0.1.0)

Copy Markdown View Source

A single operation (movement) on a statement, built from a 04 record and enriched by any following 05 detail records.

The 05 details are decoded into a CFONB.Operation.Details struct, so an operation exposes ready-to-use fields such as details.debtor or details.operation_reference.

Field names mirror the Ruby cfonb gem.

Summary

Functions

Returns the operation type code: the interbank operation code followed by its direction — "C" (credit) when the amount is positive, "D" (debit) otherwise.

Types

t()

@type t() :: %CFONB.Operation{
  amount: Decimal.t(),
  currency: String.t(),
  date: Date.t() | nil,
  details: CFONB.Operation.Details.t(),
  exoneration_code: String.t(),
  interbank_code: String.t(),
  internal_code: String.t(),
  label: String.t(),
  number: integer() | nil,
  raw: String.t() | nil,
  reference: String.t(),
  rejection_code: String.t(),
  unavailability_code: String.t(),
  value_date: Date.t() | nil
}

Functions

type_code(operation)

@spec type_code(t()) :: String.t()

Returns the operation type code: the interbank operation code followed by its direction — "C" (credit) when the amount is positive, "D" (debit) otherwise.