Class: ModernTreasury::Models::LedgerAccount

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

Overview

Defined Under Namespace

Modules: LedgerableType Classes: Balances

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(available_balance: , effective_at_lower_bound: , effective_at_upper_bound: , pending_balance: , posted_balance: ) ⇒ Object

Some parameter documentations has been truncated, see Balances for more details.

The pending, posted, and available balances for this 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.

Parameters:

  • available_balance (ModernTreasury::Models::LedgerBalance) (defaults to: )

    The available_balance is the sum of all posted inbound entries and pending outbo

  • effective_at_lower_bound (Time, nil) (defaults to: )

    The inclusive lower bound of the effective_at timestamp for the returned balance

  • effective_at_upper_bound (Time, nil) (defaults to: )

    The exclusive upper bound of the effective_at timestamp for the returned balance

  • pending_balance (ModernTreasury::Models::LedgerBalance) (defaults to: )

    The pending_balance is the sum of all pending and posted entries.

  • posted_balance (ModernTreasury::Models::LedgerBalance) (defaults to: )

    The posted_balance is the sum of all posted entries.



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


Instance Attribute Details

#balancesModernTreasury::Models::LedgerAccount::Balances

The pending, posted, and available balances for this 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.



20
# File 'lib/modern_treasury/models/ledger_account.rb', line 20

required :balances, -> { ModernTreasury::LedgerAccount::Balances }

#created_atTime

Returns:

  • (Time)


25
# File 'lib/modern_treasury/models/ledger_account.rb', line 25

required :created_at, Time

#descriptionString?

The description of the ledger account.

Returns:

  • (String, nil)


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

required :description, String, nil?: true

#discarded_atTime?

Returns:

  • (Time, nil)


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

required :discarded_at, Time, nil?: true

#external_idString?

An optional user-defined 180 character unique identifier.

Returns:

  • (String, nil)


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

required :external_id, String, nil?: true

#idString

Returns:

  • (String)


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

required :id, String

#ledger_idString

The id of the ledger that this account belongs to.

Returns:

  • (String)


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

required :ledger_id, String

#ledgerable_idString?

If the ledger account links to another object in Modern Treasury, the id will be populated here, otherwise null.

Returns:

  • (String, nil)


55
# File 'lib/modern_treasury/models/ledger_account.rb', line 55

required :ledgerable_id, String, nil?: true

#ledgerable_typeSymbol, ...

If the ledger account links to another object in Modern Treasury, the type will be populated here, otherwise null. The value is one of internal_account or external_account.



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

required :ledgerable_type, enum: -> { ModernTreasury::LedgerAccount::LedgerableType }, nil?: true

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


70
# File 'lib/modern_treasury/models/ledger_account.rb', line 70

required :live_mode, ModernTreasury::Internal::Type::Boolean

#lock_versionInteger

Lock version of the ledger account.

Returns:

  • (Integer)


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

required :lock_version, Integer

#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_account.rb', line 83

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

#nameString

The name of the ledger account.

Returns:

  • (String)


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

required :name, String

#normal_balanceSymbol, ModernTreasury::Models::TransactionDirection

The normal balance of the ledger account.



95
# File 'lib/modern_treasury/models/ledger_account.rb', line 95

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

#objectString

Returns:

  • (String)


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

required :object, String

#updated_atTime

Returns:

  • (Time)


105
# File 'lib/modern_treasury/models/ledger_account.rb', line 105

required :updated_at, Time