Class: ModernTreasury::Models::LedgerTransaction

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/modern_treasury/models/ledger_transaction.rb

Overview

Defined Under Namespace

Modules: LedgerableType, Status

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id: , archived_reason: , created_at: , description: , effective_at: , effective_date: , external_id: , ledger_entries: , ledger_id: , ledgerable_id: , ledgerable_type: , live_mode: , metadata: , object: , partially_posts_ledger_transaction_id: , posted_at: , reversed_by_ledger_transaction_id: , reverses_ledger_transaction_id: , status: , updated_at: ) ⇒ Object

Some parameter documentations has been truncated, see ModernTreasury::Models::LedgerTransaction for more details.

Parameters:

  • id (String) (defaults to: )
  • archived_reason (String, nil) (defaults to: )

    System-set reason why the ledger transaction was archived; currently only ‘balan

  • created_at (Time) (defaults to: )
  • description (String, nil) (defaults to: )

    An optional description for internal use.

  • effective_at (Time) (defaults to: )

    The timestamp (ISO8601 format) at which the ledger transaction happened for repo

  • effective_date (Date) (defaults to: )

    The date (YYYY-MM-DD) on which the ledger transaction happened for reporting pur

  • external_id (String, nil) (defaults to: )

    A unique string to represent the ledger transaction. Only one pending or posted

  • ledger_entries (Array<ModernTreasury::Models::LedgerEntry>) (defaults to: )

    An array of ledger entry objects.

  • ledger_id (String) (defaults to: )

    The ID of the ledger this ledger transaction belongs to.

  • ledgerable_id (String, nil) (defaults to: )

    If the ledger transaction can be reconciled to another object in Modern Treasury

  • ledgerable_type (Symbol, ModernTreasury::Models::LedgerTransaction::LedgerableType, nil) (defaults to: )

    If the ledger transaction can be reconciled to another object in Modern Treasury

  • live_mode (Boolean) (defaults to: )

    This field will be true if this object exists in the live environment or false i

  • metadata (Hash{Symbol=>String}) (defaults to: )

    Additional data represented as key-value pairs. Both the key and value must be s

  • object (String) (defaults to: )
  • partially_posts_ledger_transaction_id (String, nil) (defaults to: )

    The ID of the ledger transaction that this ledger transaction partially posts.

  • posted_at (Time, nil) (defaults to: )

    The time on which the ledger transaction posted. This is null if the ledger tran

  • reversed_by_ledger_transaction_id (String, nil) (defaults to: )

    The ID of the ledger transaction that reversed this ledger transaction.

  • reverses_ledger_transaction_id (String, nil) (defaults to: )

    The ID of the original ledger transaction that this ledger transaction reverses.

  • status (Symbol, ModernTreasury::Models::LedgerTransaction::Status) (defaults to: )

    To post a ledger transaction at creation, use ‘posted`.

  • updated_at (Time) (defaults to: )


# File 'lib/modern_treasury/models/ledger_transaction.rb', line 135


Instance Attribute Details

#archived_reasonString?

System-set reason why the ledger transaction was archived; currently only ‘balance_lock_failure’ for transactions that violated balance constraints. Only populated when archive_on_balance_lock_failure is true and a balance lock violation occurs, otherwise null.

Returns:

  • (String, nil)


19
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 19

required :archived_reason, String, nil?: true

#created_atTime

Returns:

  • (Time)


24
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 24

required :created_at, Time

#descriptionString?

An optional description for internal use.

Returns:

  • (String, nil)


30
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 30

required :description, String, nil?: true

#effective_atTime

The timestamp (ISO8601 format) at which the ledger transaction happened for reporting purposes.

Returns:

  • (Time)


37
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 37

required :effective_at, Time

#effective_dateDate

The date (YYYY-MM-DD) on which the ledger transaction happened for reporting purposes.

Returns:

  • (Date)


44
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 44

required :effective_date, Date

#external_idString?

A unique string to represent the ledger transaction. Only one pending or posted ledger transaction may have this ID in the ledger.

Returns:

  • (String, nil)


51
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 51

required :external_id, String, nil?: true

#idString

Returns:

  • (String)


10
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 10

required :id, String

#ledger_entriesArray<ModernTreasury::Models::LedgerEntry>

An array of ledger entry objects.



57
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 57

required :ledger_entries, -> { ModernTreasury::Internal::Type::ArrayOf[ModernTreasury::LedgerEntry] }

#ledger_idString

The ID of the ledger this ledger transaction belongs to.

Returns:

  • (String)


63
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 63

required :ledger_id, String

#ledgerable_idString?

If the ledger transaction can be reconciled to another object in Modern Treasury, the id will be populated here, otherwise null.

Returns:

  • (String, nil)


70
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 70

required :ledgerable_id, String, nil?: true

#ledgerable_typeSymbol, ...

If the ledger transaction can be reconciled to another object in Modern Treasury, the type will be populated here, otherwise null. This can be one of payment_order, incoming_payment_detail, expected_payment, return, or reversal.



78
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 78

required :ledgerable_type, enum: -> { ModernTreasury::LedgerTransaction::LedgerableType }, nil?: true

#live_modeBoolean

This field will be true if this object exists in the live environment or false if it exists in the test environment.

Returns:

  • (Boolean)


85
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 85

required :live_mode, ModernTreasury::Internal::Type::Boolean

#metadataHash{Symbol=>String}

Additional data represented as key-value pairs. Both the key and value must be strings.

Returns:

  • (Hash{Symbol=>String})


92
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 92

required :metadata, ModernTreasury::Internal::Type::HashOf[String]

#objectString

Returns:

  • (String)


97
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 97

required :object, String

#partially_posts_ledger_transaction_idString?

The ID of the ledger transaction that this ledger transaction partially posts.

Returns:

  • (String, nil)


103
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 103

required :partially_posts_ledger_transaction_id, String, nil?: true

#posted_atTime?

The time on which the ledger transaction posted. This is null if the ledger transaction is pending.

Returns:

  • (Time, nil)


110
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 110

required :posted_at, Time, nil?: true

#reversed_by_ledger_transaction_idString?

The ID of the ledger transaction that reversed this ledger transaction.

Returns:

  • (String, nil)


116
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 116

required :reversed_by_ledger_transaction_id, String, nil?: true

#reverses_ledger_transaction_idString?

The ID of the original ledger transaction that this ledger transaction reverses.

Returns:

  • (String, nil)


122
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 122

required :reverses_ledger_transaction_id, String, nil?: true

#statusSymbol, ModernTreasury::Models::LedgerTransaction::Status

To post a ledger transaction at creation, use ‘posted`.



128
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 128

required :status, enum: -> { ModernTreasury::LedgerTransaction::Status }

#updated_atTime

Returns:

  • (Time)


133
# File 'lib/modern_treasury/models/ledger_transaction.rb', line 133

required :updated_at, Time

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/modern_treasury/models/ledger_transaction.rb', line 193