Class: ModernTreasury::Models::LedgerEntry
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- ModernTreasury::Models::LedgerEntry
- Defined in:
- lib/modern_treasury/models/ledger_entry.rb
Overview
Defined Under Namespace
Modules: Status
Instance Attribute Summary collapse
-
#amount ⇒ Integer
Value in specified currency’s smallest unit.
- #created_at ⇒ Time
-
#direction ⇒ Symbol, ModernTreasury::Models::TransactionDirection
One of ‘credit`, `debit`.
- #discarded_at ⇒ Time?
-
#effective_at ⇒ Time
The timestamp (ISO8601 format) at which the ledger transaction happened for reporting purposes.
- #id ⇒ String
-
#ledger_account_currency ⇒ String
The currency of the ledger account.
-
#ledger_account_currency_exponent ⇒ Integer
The currency exponent of the ledger account.
-
#ledger_account_id ⇒ String
The ledger account that this ledger entry is associated with.
-
#ledger_account_lock_version ⇒ Integer?
Lock version of the ledger account.
-
#ledger_transaction_id ⇒ String
The ledger transaction that this ledger entry is associated with.
-
#live_mode ⇒ Boolean
This field will be true if this object exists in the live environment or false if it exists in the test environment.
-
#metadata ⇒ Hash{Symbol=>String}
Additional data represented as key-value pairs.
- #object ⇒ String
-
#resulting_ledger_account_balances ⇒ ModernTreasury::Models::LedgerBalances?
The pending, posted, and available balances for this ledger entry’s ledger account.
-
#status ⇒ Symbol, ModernTreasury::Models::LedgerEntry::Status
Equal to the state of the ledger transaction when the ledger entry was created.
- #updated_at ⇒ Time
Instance Method Summary collapse
-
#initialize(id:, amount:, created_at:, direction:, discarded_at:, effective_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
constructor
Some parameter documentations has been truncated, see LedgerEntry for more details.
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:, effective_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.
|
|
# File 'lib/modern_treasury/models/ledger_entry.rb', line 121
|
Instance Attribute Details
#amount ⇒ Integer
Value in specified currency’s smallest unit. e.g. $10 would be represented as 1000. Can be any integer up to 36 digits.
17 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 17 required :amount, Integer |
#created_at ⇒ Time
22 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 22 required :created_at, Time |
#direction ⇒ Symbol, 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_at ⇒ Time?
36 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 36 required :discarded_at, Time, nil?: true |
#effective_at ⇒ Time
The timestamp (ISO8601 format) at which the ledger transaction happened for reporting purposes.
43 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 43 required :effective_at, Time |
#id ⇒ String
10 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 10 required :id, String |
#ledger_account_currency ⇒ String
The currency of the ledger account.
49 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 49 required :ledger_account_currency, String |
#ledger_account_currency_exponent ⇒ Integer
The currency exponent of the ledger account.
55 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 55 required :ledger_account_currency_exponent, Integer |
#ledger_account_id ⇒ String
The ledger account that this ledger entry is associated with.
61 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 61 required :ledger_account_id, String |
#ledger_account_lock_version ⇒ Integer?
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.
70 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 70 required :ledger_account_lock_version, Integer, nil?: true |
#ledger_transaction_id ⇒ String
The ledger transaction that this ledger entry is associated with.
76 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 76 required :ledger_transaction_id, String |
#live_mode ⇒ Boolean
This field will be true if this object exists in the live environment or false if it exists in the test environment.
83 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 83 required :live_mode, ModernTreasury::Internal::Type::Boolean |
#metadata ⇒ Hash{Symbol=>String}
Additional data represented as key-value pairs. Both the key and value must be strings.
90 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 90 required :metadata, ModernTreasury::Internal::Type::HashOf[String] |
#object ⇒ String
95 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 95 required :object, String |
#resulting_ledger_account_balances ⇒ ModernTreasury::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.
107 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 107 required :resulting_ledger_account_balances, -> { ModernTreasury::LedgerBalances }, nil?: true |
#status ⇒ Symbol, ModernTreasury::Models::LedgerEntry::Status
Equal to the state of the ledger transaction when the ledger entry was created. One of ‘pending`, `posted`, or `archived`.
114 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 114 required :status, enum: -> { ModernTreasury::LedgerEntry::Status } |
#updated_at ⇒ Time
119 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 119 required :updated_at, Time |