Class: ModernTreasury::Models::LedgerEntryCreateRequest

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/modern_treasury/models/ledger_entry_create_request.rb,
sig/modern_treasury/models/ledger_entry_create_request.rbs

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(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.

Parameters:

  • direction (Symbol, ModernTreasury::Models::TransactionDirection)

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

  • ledger_account_id (String)

    The ledger account that this ledger entry is associated with.

  • amount (Integer) (defaults to: nil)

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

  • amount_string (String) (defaults to: nil)

    The amount of the ledger entry as a string, preserving full precision for values

  • available_balance_amount (Hash{Symbol=>Integer}, nil) (defaults to: nil)

    Use gt (>), gte (>=), lt (<), lte (<=), or eq (=) to lock on the accou

  • effective_at (Time) (defaults to: nil)

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

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

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

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

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

  • pending_balance_amount (Hash{Symbol=>Integer}, nil) (defaults to: nil)

    Use gt (>), gte (>=), lt (<), lte (<=), or eq (=) to lock on the accou

  • posted_balance_amount (Hash{Symbol=>Integer}, nil) (defaults to: nil)

    Use gt (>), gte (>=), lt (<), lte (<=), or eq (=) to lock on the accou

  • show_resulting_ledger_account_balances (Boolean, nil) (defaults to: nil)

    If true, response will include the balance of the associated ledger account for



# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 89

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.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


26
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 26

optional :amount, Integer

#amount_stringString?

The amount of the ledger entry as a string, preserving full precision for values that may exceed safe integer limits in some languages.

Parameters:

  • (String)

Returns:

  • (String, nil)


33
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 33

optional :amount_string, String

#available_balance_amountHash{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.

Parameters:

  • value (::Hash[Symbol, Integer], nil)

Returns:

  • (Hash{Symbol=>Integer}, nil)


41
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 41

optional :available_balance_amount, ModernTreasury::Internal::Type::HashOf[Integer], nil?: true

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

Parameters:

  • value (ModernTreasury::Models::transaction_direction)

Returns:



13
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 13

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

#effective_atTime?

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

Parameters:

  • (Time)

Returns:

  • (Time, nil)


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

optional :effective_at, Time

#ledger_account_idString

The ledger account that this ledger entry is associated with.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :ledger_account_id, String

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

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


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

optional :lock_version, Integer, nil?: true

#metadataHash{Symbol=>String}?

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

Parameters:

  • (::Hash[Symbol, String])

Returns:

  • (Hash{Symbol=>String}, nil)


64
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 64

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

#pending_balance_amountHash{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.

Parameters:

  • value (::Hash[Symbol, Integer], nil)

Returns:

  • (Hash{Symbol=>Integer}, nil)


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_amountHash{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.

Parameters:

  • value (::Hash[Symbol, Integer], nil)

Returns:

  • (Hash{Symbol=>Integer}, nil)


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_balancesBoolean?

If true, response will include the balance of the associated ledger account for the entry.

Parameters:

  • value (Boolean, nil)

Returns:

  • (Boolean, nil)


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{

Returns:

  • ({)


63
# File 'sig/modern_treasury/models/ledger_entry_create_request.rbs', line 63

def to_hash: -> {