Class: ModernTreasury::Models::LedgerEntryCreateRequest
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- ModernTreasury::Models::LedgerEntryCreateRequest
- Defined in:
- lib/modern_treasury/models/ledger_entry_create_request.rb,
sig/modern_treasury/models/ledger_entry_create_request.rbs
Instance Attribute Summary collapse
-
#amount ⇒ Integer?
Value in specified currency's smallest unit.
-
#amount_string ⇒ String?
The amount of the ledger entry as a string, preserving full precision for values that may exceed safe integer limits in some languages.
-
#available_balance_amount ⇒ Hash{Symbol=>Integer}?
Use
gt(>),gte(>=),lt(<),lte(<=), oreq(=) to lock on the account’s available balance. -
#direction ⇒ Symbol, ModernTreasury::Models::TransactionDirection
One of
credit,debit. -
#effective_at ⇒ Time?
The timestamp (ISO8601 format) at which the ledger transaction happened for reporting purposes.
-
#ledger_account_id ⇒ String
The ledger account that this ledger entry is associated with.
-
#lock_version ⇒ Integer?
Lock version of the ledger account.
-
#metadata ⇒ Hash{Symbol=>String}?
Additional data represented as key-value pairs.
-
#pending_balance_amount ⇒ Hash{Symbol=>Integer}?
Use
gt(>),gte(>=),lt(<),lte(<=), oreq(=) to lock on the account’s pending balance. -
#posted_balance_amount ⇒ Hash{Symbol=>Integer}?
Use
gt(>),gte(>=),lt(<),lte(<=), oreq(=) to lock on the account’s posted balance. -
#show_resulting_ledger_account_balances ⇒ Boolean?
If true, response will include the balance of the associated ledger account for the entry.
Instance Method Summary collapse
-
#initialize(direction:, ledger_account_id:, amount: nil, amount_string: nil, available_balance_amount: nil, effective_at: nil, lock_version: nil, metadata: nil, pending_balance_amount: nil, posted_balance_amount: nil, show_resulting_ledger_account_balances: nil) ⇒ Object
constructor
Some parameter documentations has been truncated, see LedgerEntryCreateRequest for more details.
- #to_hash ⇒ {
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(direction:, ledger_account_id:, amount: nil, amount_string: nil, available_balance_amount: nil, effective_at: nil, lock_version: nil, metadata: nil, pending_balance_amount: nil, posted_balance_amount: nil, show_resulting_ledger_account_balances: nil) ⇒ Object
Some parameter documentations has been truncated, see ModernTreasury::Models::LedgerEntryCreateRequest for more details.
|
|
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 89
|
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.
26 |
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 26 optional :amount, Integer |
#amount_string ⇒ String?
The amount of the ledger entry as a string, preserving full precision for values that may exceed safe integer limits in some languages.
33 |
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 33 optional :amount_string, String |
#available_balance_amount ⇒ Hash{Symbol=>Integer}?
Use gt (>), gte (>=), lt (<), lte (<=), or eq (=) to lock on the
account’s available balance. If any of these conditions would be false after the
transaction is created, the entire call will fail with error code 422.
41 |
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 41 optional :available_balance_amount, ModernTreasury::Internal::Type::HashOf[Integer], nil?: true |
#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.
13 |
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 13 required :direction, enum: -> { ModernTreasury::TransactionDirection } |
#effective_at ⇒ Time?
The timestamp (ISO8601 format) at which the ledger transaction happened for reporting purposes.
48 |
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 48 optional :effective_at, Time |
#ledger_account_id ⇒ String
The ledger account that this ledger entry is associated with.
19 |
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 19 required :ledger_account_id, String |
#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.
57 |
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 57 optional :lock_version, Integer, nil?: true |
#metadata ⇒ Hash{Symbol=>String}?
Additional data represented as key-value pairs. Both the key and value must be strings.
64 |
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 64 optional :metadata, ModernTreasury::Internal::Type::HashOf[String] |
#pending_balance_amount ⇒ Hash{Symbol=>Integer}?
Use gt (>), gte (>=), lt (<), lte (<=), or eq (=) to lock on the
account’s pending balance. If any of these conditions would be false after the
transaction is created, the entire call will fail with error code 422.
72 |
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 72 optional :pending_balance_amount, ModernTreasury::Internal::Type::HashOf[Integer], nil?: true |
#posted_balance_amount ⇒ Hash{Symbol=>Integer}?
Use gt (>), gte (>=), lt (<), lte (<=), or eq (=) to lock on the
account’s posted balance. If any of these conditions would be false after the
transaction is created, the entire call will fail with error code 422.
80 |
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 80 optional :posted_balance_amount, ModernTreasury::Internal::Type::HashOf[Integer], nil?: true |
#show_resulting_ledger_account_balances ⇒ Boolean?
If true, response will include the balance of the associated ledger account for the entry.
87 |
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 87 optional :show_resulting_ledger_account_balances, ModernTreasury::Internal::Type::Boolean, nil?: true |
Instance Method Details
#to_hash ⇒ {
63 |
# File 'sig/modern_treasury/models/ledger_entry_create_request.rbs', line 63
def to_hash: -> {
|