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?
- #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: , 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: , 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 114
|
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 |
#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.
42 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 42 required :ledger_account_currency, String |
#ledger_account_currency_exponent ⇒ Integer
The currency exponent of the ledger account.
48 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 48 required :ledger_account_currency_exponent, Integer |
#ledger_account_id ⇒ String
The ledger account that this ledger entry is associated with.
54 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 54 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.
63 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 63 required :ledger_account_lock_version, Integer, nil?: true |
#ledger_transaction_id ⇒ String
The ledger transaction that this ledger entry is associated with.
69 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 69 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.
76 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 76 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.
83 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 83 required :metadata, ModernTreasury::Internal::Type::HashOf[String] |
#object ⇒ String
88 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 88 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.
100 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 100 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`.
107 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 107 required :status, enum: -> { ModernTreasury::LedgerEntry::Status } |
#updated_at ⇒ Time
112 |
# File 'lib/modern_treasury/models/ledger_entry.rb', line 112 required :updated_at, Time |