Class: ModernTreasury::Models::LedgerEntry

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

Overview

Defined Under Namespace

Modules: Status

Instance Attribute 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: , amount: , created_at: , direction: , discarded_at: , ledger_account_currency: , ledger_account_currency_exponent: , ledger_account_id: , ledger_account_lock_version: , ledger_transaction_id: , live_mode: , metadata: , object: , resulting_ledger_account_balances: , status: , updated_at: ) ⇒ Object

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

Parameters:

  • id (String) (defaults to: )
  • amount (Integer) (defaults to: )

    Value in specified currency’s smallest unit. e.g. $10 would be represented as 10

  • created_at (Time) (defaults to: )
  • direction (Symbol, ModernTreasury::Models::TransactionDirection) (defaults to: )

    One of ‘credit`, `debit`. Describes the direction money is flowing in the transa

  • discarded_at (Time, nil) (defaults to: )
  • ledger_account_currency (String) (defaults to: )

    The currency of the ledger account.

  • ledger_account_currency_exponent (Integer) (defaults to: )

    The currency exponent of the ledger account.

  • ledger_account_id (String) (defaults to: )

    The ledger account that this ledger entry is associated with.

  • ledger_account_lock_version (Integer, nil) (defaults to: )

    Lock version of the ledger account. This can be passed when creating a ledger tr

  • ledger_transaction_id (String) (defaults to: )

    The ledger transaction that this ledger entry is associated with.

  • 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: )
  • resulting_ledger_account_balances (ModernTreasury::Models::LedgerBalances, nil) (defaults to: )

    The pending, posted, and available balances for this ledger entry’s ledger accou

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

    Equal to the state of the ledger transaction when the ledger entry was created.

  • updated_at (Time) (defaults to: )


# File 'lib/modern_treasury/models/ledger_entry.rb', line 114


Instance Attribute Details

#amountInteger

Value in specified currency’s smallest unit. e.g. $10 would be represented as 1000. Can be any integer up to 36 digits.

Returns:

  • (Integer)


17
# File 'lib/modern_treasury/models/ledger_entry.rb', line 17

required :amount, Integer

#created_atTime

Returns:

  • (Time)


22
# File 'lib/modern_treasury/models/ledger_entry.rb', line 22

required :created_at, Time

#directionSymbol, ModernTreasury::Models::TransactionDirection

One of ‘credit`, `debit`. Describes the direction money is flowing in the transaction. A `credit` moves money from your account to someone else’s. A ‘debit` pulls money from someone else’s account to your own. Note that wire, rtp, and check payments will always be ‘credit`.



31
# File 'lib/modern_treasury/models/ledger_entry.rb', line 31

required :direction, enum: -> { ModernTreasury::TransactionDirection }

#discarded_atTime?

Returns:

  • (Time, nil)


36
# File 'lib/modern_treasury/models/ledger_entry.rb', line 36

required :discarded_at, Time, nil?: true

#idString

Returns:

  • (String)


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

required :id, String

#ledger_account_currencyString

The currency of the ledger account.

Returns:

  • (String)


42
# File 'lib/modern_treasury/models/ledger_entry.rb', line 42

required :ledger_account_currency, String

#ledger_account_currency_exponentInteger

The currency exponent of the ledger account.

Returns:

  • (Integer)


48
# File 'lib/modern_treasury/models/ledger_entry.rb', line 48

required :ledger_account_currency_exponent, Integer

#ledger_account_idString

The ledger account that this ledger entry is associated with.

Returns:

  • (String)


54
# File 'lib/modern_treasury/models/ledger_entry.rb', line 54

required :ledger_account_id, String

#ledger_account_lock_versionInteger?

Lock version of the ledger account. This can be passed when creating a ledger transaction to only succeed if no ledger transactions have posted since the given version. See our post about Designing the Ledgers API with Optimistic Locking for more details.

Returns:

  • (Integer, nil)


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

required :ledger_account_lock_version, Integer, nil?: true

#ledger_transaction_idString

The ledger transaction that this ledger entry is associated with.

Returns:

  • (String)


69
# File 'lib/modern_treasury/models/ledger_entry.rb', line 69

required :ledger_transaction_id, String

#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)


76
# File 'lib/modern_treasury/models/ledger_entry.rb', line 76

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})


83
# File 'lib/modern_treasury/models/ledger_entry.rb', line 83

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

#objectString

Returns:

  • (String)


88
# File 'lib/modern_treasury/models/ledger_entry.rb', line 88

required :object, String

#resulting_ledger_account_balancesModernTreasury::Models::LedgerBalances?

The pending, posted, and available balances for this ledger entry’s ledger account. The posted balance is the sum of all posted entries on the account. The pending balance is the sum of all pending and posted entries on the account. The available balance is the posted incoming entries minus the sum of the pending and posted outgoing amounts. Please see docs.moderntreasury.com/docs/transaction-status-and-balances for more details.



100
# File 'lib/modern_treasury/models/ledger_entry.rb', line 100

required :resulting_ledger_account_balances, -> { ModernTreasury::LedgerBalances }, nil?: true

#statusSymbol, ModernTreasury::Models::LedgerEntry::Status

Equal to the state of the ledger transaction when the ledger entry was created. One of ‘pending`, `posted`, or `archived`.



107
# File 'lib/modern_treasury/models/ledger_entry.rb', line 107

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

#updated_atTime

Returns:

  • (Time)


112
# File 'lib/modern_treasury/models/ledger_entry.rb', line 112

required :updated_at, Time