modern_treasury 0.1.0.pre.alpha.22 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +38 -0
- data/README.md +1 -1
- data/lib/modern_treasury/client.rb +0 -12
- data/lib/modern_treasury/internal/transport/base_client.rb +1 -1
- data/lib/modern_treasury/internal/type/base_model.rb +4 -4
- data/lib/modern_treasury/models/accounting.rb +30 -0
- data/lib/modern_treasury/models/address.rb +94 -0
- data/lib/modern_treasury/models/address_request.rb +54 -0
- data/lib/modern_treasury/models/bulk_request_create_params.rb +144 -1505
- data/lib/modern_treasury/models/child_legal_entity_create.rb +275 -0
- data/lib/modern_treasury/models/connection_legal_entity_create_params.rb +10 -627
- data/lib/modern_treasury/models/contact_detail.rb +81 -0
- data/lib/modern_treasury/models/contact_detail_create_request.rb +34 -0
- data/lib/modern_treasury/models/counterparty.rb +24 -177
- data/lib/modern_treasury/models/counterparty_create_params.rb +37 -838
- data/lib/modern_treasury/models/counterparty_list_params.rb +9 -1
- data/lib/modern_treasury/models/document.rb +4 -6
- data/lib/modern_treasury/models/document_create_params.rb +0 -2
- data/lib/modern_treasury/models/document_list_params.rb +4 -6
- data/lib/modern_treasury/models/expected_payment.rb +9 -1
- data/lib/modern_treasury/models/expected_payment_create_params.rb +12 -230
- data/lib/modern_treasury/models/expected_payment_list_params.rb +8 -1
- data/lib/modern_treasury/models/expected_payment_update_params.rb +9 -1
- data/lib/modern_treasury/models/external_account.rb +15 -177
- data/lib/modern_treasury/models/external_account_create_params.rb +18 -210
- data/lib/modern_treasury/models/external_account_list_params.rb +9 -1
- data/lib/modern_treasury/models/external_account_update_params.rb +3 -52
- data/lib/modern_treasury/models/foreign_exchange_quote.rb +3 -73
- data/lib/modern_treasury/models/foreign_exchange_rate.rb +71 -0
- data/lib/modern_treasury/models/identification_create_request.rb +86 -0
- data/lib/modern_treasury/models/internal_account.rb +3 -95
- data/lib/modern_treasury/models/internal_account_update_account_capability_params.rb +34 -0
- data/lib/modern_treasury/models/internal_account_update_account_capability_response.rb +131 -0
- data/lib/modern_treasury/models/invoice.rb +3 -81
- data/lib/modern_treasury/models/invoice_create_params.rb +3 -83
- data/lib/modern_treasury/models/invoice_update_params.rb +3 -83
- data/lib/modern_treasury/models/ledger_account.rb +9 -141
- data/lib/modern_treasury/models/ledger_account_balance_monitor.rb +3 -182
- data/lib/modern_treasury/models/ledger_account_category.rb +3 -175
- data/lib/modern_treasury/models/ledger_account_category_list_params.rb +9 -5
- data/lib/modern_treasury/models/ledger_account_category_retrieve_params.rb +4 -2
- data/lib/modern_treasury/models/ledger_account_create_params.rb +2 -105
- data/lib/modern_treasury/models/ledger_account_create_request.rb +113 -0
- data/lib/modern_treasury/models/ledger_account_statement_create_response.rb +6 -360
- data/lib/modern_treasury/models/ledger_account_statement_retrieve_response.rb +6 -360
- data/lib/modern_treasury/models/ledger_balance.rb +45 -0
- data/lib/modern_treasury/models/ledger_balances.rb +38 -0
- data/lib/modern_treasury/models/ledger_entry.rb +3 -183
- data/lib/modern_treasury/models/ledger_entry_create_request.rb +98 -0
- data/lib/modern_treasury/models/ledger_entry_list_params.rb +48 -8
- data/lib/modern_treasury/models/ledger_transaction.rb +14 -6
- data/lib/modern_treasury/models/ledger_transaction_create_params.rb +2 -212
- data/lib/modern_treasury/models/ledger_transaction_create_request.rb +123 -0
- data/lib/modern_treasury/models/ledger_transaction_create_reversal_params.rb +0 -1
- data/lib/modern_treasury/models/ledger_transaction_list_params.rb +44 -7
- data/lib/modern_treasury/models/ledger_transaction_update_params.rb +5 -104
- data/lib/modern_treasury/models/ledger_transactions/ledger_transaction_version.rb +15 -193
- data/lib/modern_treasury/models/legal_entity_address_create_request.rb +78 -0
- data/lib/modern_treasury/models/legal_entity_association.rb +1 -0
- data/lib/modern_treasury/models/legal_entity_association_create_params.rb +4 -448
- data/lib/modern_treasury/models/legal_entity_create_params.rb +10 -618
- data/lib/modern_treasury/models/legal_entity_update_params.rb +6 -165
- data/lib/modern_treasury/models/line_item.rb +3 -29
- data/lib/modern_treasury/models/payment_action_list_params.rb +1 -0
- data/lib/modern_treasury/models/payment_order.rb +13 -102
- data/lib/modern_treasury/models/payment_order_create_async_params.rb +24 -477
- data/lib/modern_treasury/models/payment_order_create_params.rb +24 -479
- data/lib/modern_treasury/models/payment_order_update_params.rb +21 -248
- data/lib/modern_treasury/models/payment_orders/reversal_create_params.rb +3 -232
- data/lib/modern_treasury/models/payment_reference.rb +7 -1
- data/lib/modern_treasury/models/return_list_params.rb +5 -6
- data/lib/modern_treasury/models/return_object.rb +7 -3
- data/lib/modern_treasury/models/routing_detail.rb +3 -93
- data/lib/modern_treasury/models/routing_number_lookup_request.rb +3 -55
- data/lib/modern_treasury/models/transaction.rb +5 -73
- data/lib/modern_treasury/models/transactions/transaction_line_item.rb +0 -1
- data/lib/modern_treasury/models/virtual_account_create_params.rb +3 -117
- data/lib/modern_treasury/models.rb +31 -6
- data/lib/modern_treasury/resources/bulk_requests.rb +1 -1
- data/lib/modern_treasury/resources/counterparties.rb +20 -14
- data/lib/modern_treasury/resources/expected_payments.rb +10 -4
- data/lib/modern_treasury/resources/external_accounts.rb +23 -17
- data/lib/modern_treasury/resources/internal_accounts.rb +34 -0
- data/lib/modern_treasury/resources/invoices.rb +2 -2
- data/lib/modern_treasury/resources/ledger_account_categories.rb +1 -1
- data/lib/modern_treasury/resources/ledger_accounts.rb +1 -1
- data/lib/modern_treasury/resources/ledger_entries.rb +1 -1
- data/lib/modern_treasury/resources/ledger_transactions.rb +5 -5
- data/lib/modern_treasury/resources/legal_entities.rb +4 -4
- data/lib/modern_treasury/resources/legal_entity_associations.rb +1 -1
- data/lib/modern_treasury/resources/payment_orders/reversals.rb +1 -1
- data/lib/modern_treasury/resources/payment_orders.rb +5 -5
- data/lib/modern_treasury/resources/returns.rb +1 -1
- data/lib/modern_treasury/resources/virtual_accounts.rb +1 -1
- data/lib/modern_treasury/version.rb +1 -1
- data/lib/modern_treasury.rb +16 -6
- data/rbi/modern_treasury/client.rbi +0 -9
- data/rbi/modern_treasury/internal/transport/base_client.rbi +1 -1
- data/rbi/modern_treasury/models/accounting.rbi +48 -0
- data/rbi/modern_treasury/models/address.rbi +107 -0
- data/rbi/modern_treasury/models/address_request.rbi +76 -0
- data/rbi/modern_treasury/models/bulk_request_create_params.rbi +701 -3140
- data/rbi/modern_treasury/models/child_legal_entity_create.rbi +511 -0
- data/rbi/modern_treasury/models/connection_legal_entity_create_params.rbi +17 -1314
- data/rbi/modern_treasury/models/contact_detail.rbi +124 -0
- data/rbi/modern_treasury/models/contact_detail_create_request.rbi +99 -0
- data/rbi/modern_treasury/models/counterparty.rbi +24 -264
- data/rbi/modern_treasury/models/counterparty_create_params.rbi +47 -1718
- data/rbi/modern_treasury/models/counterparty_list_params.rbi +11 -0
- data/rbi/modern_treasury/models/document.rbi +6 -16
- data/rbi/modern_treasury/models/document_create_params.rbi +0 -10
- data/rbi/modern_treasury/models/document_list_params.rbi +6 -16
- data/rbi/modern_treasury/models/expected_payment.rbi +8 -0
- data/rbi/modern_treasury/models/expected_payment_create_params.rbi +12 -419
- data/rbi/modern_treasury/models/expected_payment_list_params.rbi +9 -0
- data/rbi/modern_treasury/models/expected_payment_update_params.rbi +8 -0
- data/rbi/modern_treasury/models/external_account.rbi +15 -244
- data/rbi/modern_treasury/models/external_account_create_params.rbi +20 -400
- data/rbi/modern_treasury/models/external_account_list_params.rbi +11 -0
- data/rbi/modern_treasury/models/external_account_update_params.rbi +4 -86
- data/rbi/modern_treasury/models/foreign_exchange_quote.rbi +4 -99
- data/rbi/modern_treasury/models/foreign_exchange_rate.rbi +96 -0
- data/rbi/modern_treasury/models/identification_create_request.rbi +212 -0
- data/rbi/modern_treasury/models/internal_account.rbi +4 -115
- data/rbi/modern_treasury/models/internal_account_update_account_capability_params.rbi +54 -0
- data/rbi/modern_treasury/models/internal_account_update_account_capability_response.rbi +304 -0
- data/rbi/modern_treasury/models/invoice.rbi +3 -128
- data/rbi/modern_treasury/models/invoice_create_params.rbi +4 -139
- data/rbi/modern_treasury/models/invoice_update_params.rbi +4 -139
- data/rbi/modern_treasury/models/ledger_account.rbi +12 -218
- data/rbi/modern_treasury/models/ledger_account_balance_monitor.rbi +4 -303
- data/rbi/modern_treasury/models/ledger_account_category.rbi +4 -301
- data/rbi/modern_treasury/models/ledger_account_category_list_params.rbi +14 -7
- data/rbi/modern_treasury/models/ledger_account_category_retrieve_params.rbi +6 -3
- data/rbi/modern_treasury/models/ledger_account_create_params.rbi +5 -173
- data/rbi/modern_treasury/models/ledger_account_create_request.rbi +194 -0
- data/rbi/modern_treasury/models/ledger_account_statement_create_response.rbi +8 -612
- data/rbi/modern_treasury/models/ledger_account_statement_retrieve_response.rbi +8 -612
- data/rbi/modern_treasury/models/ledger_balance.rbi +66 -0
- data/rbi/modern_treasury/models/ledger_balances.rbi +75 -0
- data/rbi/modern_treasury/models/ledger_entry.rbi +4 -309
- data/rbi/modern_treasury/models/ledger_entry_create_request.rbi +137 -0
- data/rbi/modern_treasury/models/ledger_entry_list_params.rbi +99 -16
- data/rbi/modern_treasury/models/ledger_transaction.rbi +17 -11
- data/rbi/modern_treasury/models/ledger_transaction_create_params.rbi +5 -383
- data/rbi/modern_treasury/models/ledger_transaction_create_request.rbi +258 -0
- data/rbi/modern_treasury/models/ledger_transaction_create_reversal_params.rbi +0 -5
- data/rbi/modern_treasury/models/ledger_transaction_list_params.rbi +93 -18
- data/rbi/modern_treasury/models/ledger_transaction_update_params.rbi +7 -158
- data/rbi/modern_treasury/models/ledger_transactions/ledger_transaction_version.rbi +18 -316
- data/rbi/modern_treasury/models/legal_entity_address_create_request.rbi +157 -0
- data/rbi/modern_treasury/models/legal_entity_association.rbi +5 -0
- data/rbi/modern_treasury/models/legal_entity_association_create_params.rbi +9 -917
- data/rbi/modern_treasury/models/legal_entity_create_params.rbi +17 -1297
- data/rbi/modern_treasury/models/legal_entity_update_params.rbi +8 -378
- data/rbi/modern_treasury/models/line_item.rbi +4 -52
- data/rbi/modern_treasury/models/payment_action_list_params.rbi +5 -0
- data/rbi/modern_treasury/models/payment_order.rbi +43 -159
- data/rbi/modern_treasury/models/payment_order_create_async_params.rbi +28 -882
- data/rbi/modern_treasury/models/payment_order_create_params.rbi +28 -887
- data/rbi/modern_treasury/models/payment_order_update_params.rbi +24 -460
- data/rbi/modern_treasury/models/payment_orders/reversal_create_params.rbi +4 -415
- data/rbi/modern_treasury/models/payment_reference.rbi +35 -5
- data/rbi/modern_treasury/models/return_list_params.rbi +6 -11
- data/rbi/modern_treasury/models/return_object.rbi +35 -12
- data/rbi/modern_treasury/models/routing_detail.rbi +4 -113
- data/rbi/modern_treasury/models/routing_number_lookup_request.rbi +4 -87
- data/rbi/modern_treasury/models/transaction.rbi +14 -103
- data/rbi/modern_treasury/models/transactions/transaction_line_item.rbi +0 -5
- data/rbi/modern_treasury/models/virtual_account_create_params.rbi +4 -203
- data/rbi/modern_treasury/models.rbi +36 -6
- data/rbi/modern_treasury/resources/bulk_requests.rbi +2 -2
- data/rbi/modern_treasury/resources/counterparties.rbi +20 -12
- data/rbi/modern_treasury/resources/documents.rbi +2 -2
- data/rbi/modern_treasury/resources/expected_payments.rbi +9 -1
- data/rbi/modern_treasury/resources/external_accounts.rbi +29 -22
- data/rbi/modern_treasury/resources/internal_accounts.rbi +24 -0
- data/rbi/modern_treasury/resources/invoices.rbi +2 -8
- data/rbi/modern_treasury/resources/ledger_account_categories.rbi +7 -3
- data/rbi/modern_treasury/resources/ledger_accounts.rbi +1 -1
- data/rbi/modern_treasury/resources/ledger_entries.rbi +9 -2
- data/rbi/modern_treasury/resources/ledger_transactions.rbi +13 -13
- data/rbi/modern_treasury/resources/legal_entities.rbi +4 -8
- data/rbi/modern_treasury/resources/legal_entity_associations.rbi +1 -2
- data/rbi/modern_treasury/resources/payment_orders/reversals.rbi +1 -1
- data/rbi/modern_treasury/resources/payment_orders.rbi +5 -8
- data/rbi/modern_treasury/resources/returns.rbi +2 -2
- data/rbi/modern_treasury/resources/virtual_accounts.rbi +1 -2
- data/sig/modern_treasury/client.rbs +0 -6
- data/sig/modern_treasury/internal/transport/base_client.rbs +1 -1
- data/sig/modern_treasury/models/accounting.rbs +15 -0
- data/sig/modern_treasury/models/address.rbs +70 -0
- data/sig/modern_treasury/models/address_request.rbs +45 -0
- data/sig/modern_treasury/models/bulk_request_create_params.rbs +88 -1089
- data/sig/modern_treasury/models/child_legal_entity_create.rbs +220 -0
- data/sig/modern_treasury/models/connection_legal_entity_create_params.rbs +21 -548
- data/sig/modern_treasury/models/contact_detail.rbs +67 -0
- data/sig/modern_treasury/models/contact_detail_create_request.rbs +43 -0
- data/sig/modern_treasury/models/counterparty.rbs +20 -141
- data/sig/modern_treasury/models/counterparty_create_params.rbs +49 -737
- data/sig/modern_treasury/models/counterparty_list_params.rbs +7 -0
- data/sig/modern_treasury/models/document.rbs +0 -4
- data/sig/modern_treasury/models/document_create_params.rbs +0 -4
- data/sig/modern_treasury/models/document_list_params.rbs +0 -4
- data/sig/modern_treasury/models/expected_payment.rbs +5 -0
- data/sig/modern_treasury/models/expected_payment_create_params.rbs +11 -173
- data/sig/modern_treasury/models/expected_payment_list_params.rbs +7 -0
- data/sig/modern_treasury/models/expected_payment_update_params.rbs +5 -0
- data/sig/modern_treasury/models/external_account.rbs +13 -139
- data/sig/modern_treasury/models/external_account_create_params.rbs +23 -189
- data/sig/modern_treasury/models/external_account_list_params.rbs +7 -0
- data/sig/modern_treasury/models/external_account_update_params.rbs +6 -48
- data/sig/modern_treasury/models/foreign_exchange_quote.rbs +4 -51
- data/sig/modern_treasury/models/foreign_exchange_rate.rbs +50 -0
- data/sig/modern_treasury/models/identification_create_request.rbs +93 -0
- data/sig/modern_treasury/models/internal_account.rbs +4 -71
- data/sig/modern_treasury/models/internal_account_update_account_capability_params.rbs +28 -0
- data/sig/modern_treasury/models/internal_account_update_account_capability_response.rbs +137 -0
- data/sig/modern_treasury/models/invoice.rbs +4 -68
- data/sig/modern_treasury/models/invoice_create_params.rbs +6 -70
- data/sig/modern_treasury/models/invoice_update_params.rbs +6 -70
- data/sig/modern_treasury/models/ledger_account.rbs +12 -123
- data/sig/modern_treasury/models/ledger_account_balance_monitor.rbs +4 -142
- data/sig/modern_treasury/models/ledger_account_category.rbs +4 -142
- data/sig/modern_treasury/models/ledger_account_category_list_params.rbs +5 -5
- data/sig/modern_treasury/models/ledger_account_create_params.rbs +4 -84
- data/sig/modern_treasury/models/ledger_account_create_request.rbs +89 -0
- data/sig/modern_treasury/models/ledger_account_statement_create_response.rbs +8 -284
- data/sig/modern_treasury/models/ledger_account_statement_retrieve_response.rbs +8 -284
- data/sig/modern_treasury/models/ledger_balance.rbs +40 -0
- data/sig/modern_treasury/models/ledger_balances.rbs +30 -0
- data/sig/modern_treasury/models/ledger_entry.rbs +4 -142
- data/sig/modern_treasury/models/ledger_entry_create_request.rbs +62 -0
- data/sig/modern_treasury/models/ledger_entry_list_params.rbs +21 -3
- data/sig/modern_treasury/models/ledger_transaction.rbs +5 -2
- data/sig/modern_treasury/models/ledger_transaction_create_params.rbs +4 -165
- data/sig/modern_treasury/models/ledger_transaction_create_request.rbs +109 -0
- data/sig/modern_treasury/models/ledger_transaction_create_reversal_params.rbs +0 -2
- data/sig/modern_treasury/models/ledger_transaction_list_params.rbs +21 -5
- data/sig/modern_treasury/models/ledger_transaction_update_params.rbs +6 -67
- data/sig/modern_treasury/models/ledger_transactions/ledger_transaction_version.rbs +9 -144
- data/sig/modern_treasury/models/legal_entity_address_create_request.rbs +68 -0
- data/sig/modern_treasury/models/legal_entity_association.rbs +3 -1
- data/sig/modern_treasury/models/legal_entity_association_create_params.rbs +9 -380
- data/sig/modern_treasury/models/legal_entity_create_params.rbs +21 -548
- data/sig/modern_treasury/models/legal_entity_update_params.rbs +12 -168
- data/sig/modern_treasury/models/line_item.rbs +4 -16
- data/sig/modern_treasury/models/payment_action_list_params.rbs +2 -1
- data/sig/modern_treasury/models/payment_order.rbs +22 -69
- data/sig/modern_treasury/models/payment_order_create_async_params.rbs +35 -380
- data/sig/modern_treasury/models/payment_order_create_params.rbs +35 -384
- data/sig/modern_treasury/models/payment_order_update_params.rbs +29 -207
- data/sig/modern_treasury/models/payment_orders/reversal_create_params.rbs +6 -173
- data/sig/modern_treasury/models/payment_reference.rbs +14 -2
- data/sig/modern_treasury/models/return_list_params.rbs +1 -6
- data/sig/modern_treasury/models/return_object.rbs +15 -10
- data/sig/modern_treasury/models/routing_detail.rbs +4 -71
- data/sig/modern_treasury/models/routing_number_lookup_request.rbs +6 -48
- data/sig/modern_treasury/models/transaction.rbs +8 -53
- data/sig/modern_treasury/models/transactions/transaction_line_item.rbs +0 -2
- data/sig/modern_treasury/models/virtual_account_create_params.rbs +6 -95
- data/sig/modern_treasury/models.rbs +30 -6
- data/sig/modern_treasury/resources/counterparties.rbs +2 -0
- data/sig/modern_treasury/resources/expected_payments.rbs +4 -1
- data/sig/modern_treasury/resources/external_accounts.rbs +6 -4
- data/sig/modern_treasury/resources/internal_accounts.rbs +7 -0
- data/sig/modern_treasury/resources/invoices.rbs +2 -2
- data/sig/modern_treasury/resources/ledger_account_categories.rbs +1 -1
- data/sig/modern_treasury/resources/ledger_accounts.rbs +1 -1
- data/sig/modern_treasury/resources/ledger_transactions.rbs +4 -4
- data/sig/modern_treasury/resources/legal_entities.rbs +4 -4
- data/sig/modern_treasury/resources/legal_entity_associations.rbs +1 -1
- data/sig/modern_treasury/resources/payment_orders/reversals.rbs +1 -1
- data/sig/modern_treasury/resources/payment_orders.rbs +5 -5
- data/sig/modern_treasury/resources/virtual_accounts.rbs +1 -1
- metadata +52 -22
- data/lib/modern_treasury/models/paper_item.rb +0 -178
- data/lib/modern_treasury/models/paper_item_list_params.rb +0 -56
- data/lib/modern_treasury/models/paper_item_retrieve_params.rb +0 -14
- data/lib/modern_treasury/resources/ledger_event_handlers.rb +0 -14
- data/lib/modern_treasury/resources/ledgerable_events.rb +0 -14
- data/lib/modern_treasury/resources/paper_items.rb +0 -68
- data/rbi/modern_treasury/models/paper_item.rbi +0 -204
- data/rbi/modern_treasury/models/paper_item_list_params.rbi +0 -88
- data/rbi/modern_treasury/models/paper_item_retrieve_params.rbi +0 -32
- data/rbi/modern_treasury/resources/ledger_event_handlers.rbi +0 -12
- data/rbi/modern_treasury/resources/ledgerable_events.rbi +0 -12
- data/rbi/modern_treasury/resources/paper_items.rbi +0 -51
- data/sig/modern_treasury/models/paper_item.rbs +0 -122
- data/sig/modern_treasury/models/paper_item_list_params.rbs +0 -54
- data/sig/modern_treasury/models/paper_item_retrieve_params.rbs +0 -15
- data/sig/modern_treasury/resources/ledger_event_handlers.rbs +0 -7
- data/sig/modern_treasury/resources/ledgerable_events.rbs +0 -7
- data/sig/modern_treasury/resources/paper_items.rbs +0 -21
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ModernTreasury
|
|
4
|
+
module Models
|
|
5
|
+
class LedgerBalance < ModernTreasury::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
ModernTreasury::LedgerBalance,
|
|
10
|
+
ModernTreasury::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(Integer) }
|
|
15
|
+
attr_accessor :amount
|
|
16
|
+
|
|
17
|
+
sig { returns(Integer) }
|
|
18
|
+
attr_accessor :credits
|
|
19
|
+
|
|
20
|
+
# The currency of the ledger account.
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :currency
|
|
23
|
+
|
|
24
|
+
# The currency exponent of the ledger account.
|
|
25
|
+
sig { returns(Integer) }
|
|
26
|
+
attr_accessor :currency_exponent
|
|
27
|
+
|
|
28
|
+
sig { returns(Integer) }
|
|
29
|
+
attr_accessor :debits
|
|
30
|
+
|
|
31
|
+
sig do
|
|
32
|
+
params(
|
|
33
|
+
amount: Integer,
|
|
34
|
+
credits: Integer,
|
|
35
|
+
currency: String,
|
|
36
|
+
currency_exponent: Integer,
|
|
37
|
+
debits: Integer
|
|
38
|
+
).returns(T.attached_class)
|
|
39
|
+
end
|
|
40
|
+
def self.new(
|
|
41
|
+
amount:,
|
|
42
|
+
credits:,
|
|
43
|
+
# The currency of the ledger account.
|
|
44
|
+
currency:,
|
|
45
|
+
# The currency exponent of the ledger account.
|
|
46
|
+
currency_exponent:,
|
|
47
|
+
debits:
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
sig do
|
|
52
|
+
override.returns(
|
|
53
|
+
{
|
|
54
|
+
amount: Integer,
|
|
55
|
+
credits: Integer,
|
|
56
|
+
currency: String,
|
|
57
|
+
currency_exponent: Integer,
|
|
58
|
+
debits: Integer
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
end
|
|
62
|
+
def to_hash
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ModernTreasury
|
|
4
|
+
module Models
|
|
5
|
+
class LedgerBalances < ModernTreasury::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
ModernTreasury::LedgerBalances,
|
|
10
|
+
ModernTreasury::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The available_balance is the sum of all posted inbound entries and pending
|
|
15
|
+
# outbound entries. For credit normal, available_amount = posted_credits -
|
|
16
|
+
# pending_debits; for debit normal, available_amount = posted_debits -
|
|
17
|
+
# pending_credits.
|
|
18
|
+
sig { returns(ModernTreasury::LedgerBalance) }
|
|
19
|
+
attr_reader :available_balance
|
|
20
|
+
|
|
21
|
+
sig do
|
|
22
|
+
params(available_balance: ModernTreasury::LedgerBalance::OrHash).void
|
|
23
|
+
end
|
|
24
|
+
attr_writer :available_balance
|
|
25
|
+
|
|
26
|
+
# The pending_balance is the sum of all pending and posted entries.
|
|
27
|
+
sig { returns(ModernTreasury::LedgerBalance) }
|
|
28
|
+
attr_reader :pending_balance
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
params(pending_balance: ModernTreasury::LedgerBalance::OrHash).void
|
|
32
|
+
end
|
|
33
|
+
attr_writer :pending_balance
|
|
34
|
+
|
|
35
|
+
# The posted_balance is the sum of all posted entries.
|
|
36
|
+
sig { returns(ModernTreasury::LedgerBalance) }
|
|
37
|
+
attr_reader :posted_balance
|
|
38
|
+
|
|
39
|
+
sig { params(posted_balance: ModernTreasury::LedgerBalance::OrHash).void }
|
|
40
|
+
attr_writer :posted_balance
|
|
41
|
+
|
|
42
|
+
sig do
|
|
43
|
+
params(
|
|
44
|
+
available_balance: ModernTreasury::LedgerBalance::OrHash,
|
|
45
|
+
pending_balance: ModernTreasury::LedgerBalance::OrHash,
|
|
46
|
+
posted_balance: ModernTreasury::LedgerBalance::OrHash
|
|
47
|
+
).returns(T.attached_class)
|
|
48
|
+
end
|
|
49
|
+
def self.new(
|
|
50
|
+
# The available_balance is the sum of all posted inbound entries and pending
|
|
51
|
+
# outbound entries. For credit normal, available_amount = posted_credits -
|
|
52
|
+
# pending_debits; for debit normal, available_amount = posted_debits -
|
|
53
|
+
# pending_credits.
|
|
54
|
+
available_balance:,
|
|
55
|
+
# The pending_balance is the sum of all pending and posted entries.
|
|
56
|
+
pending_balance:,
|
|
57
|
+
# The posted_balance is the sum of all posted entries.
|
|
58
|
+
posted_balance:
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
sig do
|
|
63
|
+
override.returns(
|
|
64
|
+
{
|
|
65
|
+
available_balance: ModernTreasury::LedgerBalance,
|
|
66
|
+
pending_balance: ModernTreasury::LedgerBalance,
|
|
67
|
+
posted_balance: ModernTreasury::LedgerBalance
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
end
|
|
71
|
+
def to_hash
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -72,19 +72,13 @@ module ModernTreasury
|
|
|
72
72
|
# and posted outgoing amounts. Please see
|
|
73
73
|
# https://docs.moderntreasury.com/docs/transaction-status-and-balances for more
|
|
74
74
|
# details.
|
|
75
|
-
sig
|
|
76
|
-
returns(
|
|
77
|
-
T.nilable(ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances)
|
|
78
|
-
)
|
|
79
|
-
end
|
|
75
|
+
sig { returns(T.nilable(ModernTreasury::LedgerBalances)) }
|
|
80
76
|
attr_reader :resulting_ledger_account_balances
|
|
81
77
|
|
|
82
78
|
sig do
|
|
83
79
|
params(
|
|
84
80
|
resulting_ledger_account_balances:
|
|
85
|
-
T.nilable(
|
|
86
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances::OrHash
|
|
87
|
-
)
|
|
81
|
+
T.nilable(ModernTreasury::LedgerBalances::OrHash)
|
|
88
82
|
).void
|
|
89
83
|
end
|
|
90
84
|
attr_writer :resulting_ledger_account_balances
|
|
@@ -113,9 +107,7 @@ module ModernTreasury
|
|
|
113
107
|
metadata: T::Hash[Symbol, String],
|
|
114
108
|
object: String,
|
|
115
109
|
resulting_ledger_account_balances:
|
|
116
|
-
T.nilable(
|
|
117
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances::OrHash
|
|
118
|
-
),
|
|
110
|
+
T.nilable(ModernTreasury::LedgerBalances::OrHash),
|
|
119
111
|
status: ModernTreasury::LedgerEntry::Status::OrSymbol,
|
|
120
112
|
updated_at: Time
|
|
121
113
|
).returns(T.attached_class)
|
|
@@ -184,9 +176,7 @@ module ModernTreasury
|
|
|
184
176
|
metadata: T::Hash[Symbol, String],
|
|
185
177
|
object: String,
|
|
186
178
|
resulting_ledger_account_balances:
|
|
187
|
-
T.nilable(
|
|
188
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances
|
|
189
|
-
),
|
|
179
|
+
T.nilable(ModernTreasury::LedgerBalances),
|
|
190
180
|
status: ModernTreasury::LedgerEntry::Status::TaggedSymbol,
|
|
191
181
|
updated_at: Time
|
|
192
182
|
}
|
|
@@ -195,301 +185,6 @@ module ModernTreasury
|
|
|
195
185
|
def to_hash
|
|
196
186
|
end
|
|
197
187
|
|
|
198
|
-
class ResultingLedgerAccountBalances < ModernTreasury::Internal::Type::BaseModel
|
|
199
|
-
OrHash =
|
|
200
|
-
T.type_alias do
|
|
201
|
-
T.any(
|
|
202
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances,
|
|
203
|
-
ModernTreasury::Internal::AnyHash
|
|
204
|
-
)
|
|
205
|
-
end
|
|
206
|
-
|
|
207
|
-
# The available_balance is the sum of all posted inbound entries and pending
|
|
208
|
-
# outbound entries. For credit normal, available_amount = posted_credits -
|
|
209
|
-
# pending_debits; for debit normal, available_amount = posted_debits -
|
|
210
|
-
# pending_credits.
|
|
211
|
-
sig do
|
|
212
|
-
returns(
|
|
213
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances::AvailableBalance
|
|
214
|
-
)
|
|
215
|
-
end
|
|
216
|
-
attr_reader :available_balance
|
|
217
|
-
|
|
218
|
-
sig do
|
|
219
|
-
params(
|
|
220
|
-
available_balance:
|
|
221
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances::AvailableBalance::OrHash
|
|
222
|
-
).void
|
|
223
|
-
end
|
|
224
|
-
attr_writer :available_balance
|
|
225
|
-
|
|
226
|
-
# The pending_balance is the sum of all pending and posted entries.
|
|
227
|
-
sig do
|
|
228
|
-
returns(
|
|
229
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances::PendingBalance
|
|
230
|
-
)
|
|
231
|
-
end
|
|
232
|
-
attr_reader :pending_balance
|
|
233
|
-
|
|
234
|
-
sig do
|
|
235
|
-
params(
|
|
236
|
-
pending_balance:
|
|
237
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances::PendingBalance::OrHash
|
|
238
|
-
).void
|
|
239
|
-
end
|
|
240
|
-
attr_writer :pending_balance
|
|
241
|
-
|
|
242
|
-
# The posted_balance is the sum of all posted entries.
|
|
243
|
-
sig do
|
|
244
|
-
returns(
|
|
245
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances::PostedBalance
|
|
246
|
-
)
|
|
247
|
-
end
|
|
248
|
-
attr_reader :posted_balance
|
|
249
|
-
|
|
250
|
-
sig do
|
|
251
|
-
params(
|
|
252
|
-
posted_balance:
|
|
253
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances::PostedBalance::OrHash
|
|
254
|
-
).void
|
|
255
|
-
end
|
|
256
|
-
attr_writer :posted_balance
|
|
257
|
-
|
|
258
|
-
# The pending, posted, and available balances for this ledger entry's ledger
|
|
259
|
-
# account. The posted balance is the sum of all posted entries on the account. The
|
|
260
|
-
# pending balance is the sum of all pending and posted entries on the account. The
|
|
261
|
-
# available balance is the posted incoming entries minus the sum of the pending
|
|
262
|
-
# and posted outgoing amounts. Please see
|
|
263
|
-
# https://docs.moderntreasury.com/docs/transaction-status-and-balances for more
|
|
264
|
-
# details.
|
|
265
|
-
sig do
|
|
266
|
-
params(
|
|
267
|
-
available_balance:
|
|
268
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances::AvailableBalance::OrHash,
|
|
269
|
-
pending_balance:
|
|
270
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances::PendingBalance::OrHash,
|
|
271
|
-
posted_balance:
|
|
272
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances::PostedBalance::OrHash
|
|
273
|
-
).returns(T.attached_class)
|
|
274
|
-
end
|
|
275
|
-
def self.new(
|
|
276
|
-
# The available_balance is the sum of all posted inbound entries and pending
|
|
277
|
-
# outbound entries. For credit normal, available_amount = posted_credits -
|
|
278
|
-
# pending_debits; for debit normal, available_amount = posted_debits -
|
|
279
|
-
# pending_credits.
|
|
280
|
-
available_balance:,
|
|
281
|
-
# The pending_balance is the sum of all pending and posted entries.
|
|
282
|
-
pending_balance:,
|
|
283
|
-
# The posted_balance is the sum of all posted entries.
|
|
284
|
-
posted_balance:
|
|
285
|
-
)
|
|
286
|
-
end
|
|
287
|
-
|
|
288
|
-
sig do
|
|
289
|
-
override.returns(
|
|
290
|
-
{
|
|
291
|
-
available_balance:
|
|
292
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances::AvailableBalance,
|
|
293
|
-
pending_balance:
|
|
294
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances::PendingBalance,
|
|
295
|
-
posted_balance:
|
|
296
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances::PostedBalance
|
|
297
|
-
}
|
|
298
|
-
)
|
|
299
|
-
end
|
|
300
|
-
def to_hash
|
|
301
|
-
end
|
|
302
|
-
|
|
303
|
-
class AvailableBalance < ModernTreasury::Internal::Type::BaseModel
|
|
304
|
-
OrHash =
|
|
305
|
-
T.type_alias do
|
|
306
|
-
T.any(
|
|
307
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances::AvailableBalance,
|
|
308
|
-
ModernTreasury::Internal::AnyHash
|
|
309
|
-
)
|
|
310
|
-
end
|
|
311
|
-
|
|
312
|
-
sig { returns(Integer) }
|
|
313
|
-
attr_accessor :amount
|
|
314
|
-
|
|
315
|
-
sig { returns(Integer) }
|
|
316
|
-
attr_accessor :credits
|
|
317
|
-
|
|
318
|
-
# The currency of the ledger account.
|
|
319
|
-
sig { returns(String) }
|
|
320
|
-
attr_accessor :currency
|
|
321
|
-
|
|
322
|
-
# The currency exponent of the ledger account.
|
|
323
|
-
sig { returns(Integer) }
|
|
324
|
-
attr_accessor :currency_exponent
|
|
325
|
-
|
|
326
|
-
sig { returns(Integer) }
|
|
327
|
-
attr_accessor :debits
|
|
328
|
-
|
|
329
|
-
# The available_balance is the sum of all posted inbound entries and pending
|
|
330
|
-
# outbound entries. For credit normal, available_amount = posted_credits -
|
|
331
|
-
# pending_debits; for debit normal, available_amount = posted_debits -
|
|
332
|
-
# pending_credits.
|
|
333
|
-
sig do
|
|
334
|
-
params(
|
|
335
|
-
amount: Integer,
|
|
336
|
-
credits: Integer,
|
|
337
|
-
currency: String,
|
|
338
|
-
currency_exponent: Integer,
|
|
339
|
-
debits: Integer
|
|
340
|
-
).returns(T.attached_class)
|
|
341
|
-
end
|
|
342
|
-
def self.new(
|
|
343
|
-
amount:,
|
|
344
|
-
credits:,
|
|
345
|
-
# The currency of the ledger account.
|
|
346
|
-
currency:,
|
|
347
|
-
# The currency exponent of the ledger account.
|
|
348
|
-
currency_exponent:,
|
|
349
|
-
debits:
|
|
350
|
-
)
|
|
351
|
-
end
|
|
352
|
-
|
|
353
|
-
sig do
|
|
354
|
-
override.returns(
|
|
355
|
-
{
|
|
356
|
-
amount: Integer,
|
|
357
|
-
credits: Integer,
|
|
358
|
-
currency: String,
|
|
359
|
-
currency_exponent: Integer,
|
|
360
|
-
debits: Integer
|
|
361
|
-
}
|
|
362
|
-
)
|
|
363
|
-
end
|
|
364
|
-
def to_hash
|
|
365
|
-
end
|
|
366
|
-
end
|
|
367
|
-
|
|
368
|
-
class PendingBalance < ModernTreasury::Internal::Type::BaseModel
|
|
369
|
-
OrHash =
|
|
370
|
-
T.type_alias do
|
|
371
|
-
T.any(
|
|
372
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances::PendingBalance,
|
|
373
|
-
ModernTreasury::Internal::AnyHash
|
|
374
|
-
)
|
|
375
|
-
end
|
|
376
|
-
|
|
377
|
-
sig { returns(Integer) }
|
|
378
|
-
attr_accessor :amount
|
|
379
|
-
|
|
380
|
-
sig { returns(Integer) }
|
|
381
|
-
attr_accessor :credits
|
|
382
|
-
|
|
383
|
-
# The currency of the ledger account.
|
|
384
|
-
sig { returns(String) }
|
|
385
|
-
attr_accessor :currency
|
|
386
|
-
|
|
387
|
-
# The currency exponent of the ledger account.
|
|
388
|
-
sig { returns(Integer) }
|
|
389
|
-
attr_accessor :currency_exponent
|
|
390
|
-
|
|
391
|
-
sig { returns(Integer) }
|
|
392
|
-
attr_accessor :debits
|
|
393
|
-
|
|
394
|
-
# The pending_balance is the sum of all pending and posted entries.
|
|
395
|
-
sig do
|
|
396
|
-
params(
|
|
397
|
-
amount: Integer,
|
|
398
|
-
credits: Integer,
|
|
399
|
-
currency: String,
|
|
400
|
-
currency_exponent: Integer,
|
|
401
|
-
debits: Integer
|
|
402
|
-
).returns(T.attached_class)
|
|
403
|
-
end
|
|
404
|
-
def self.new(
|
|
405
|
-
amount:,
|
|
406
|
-
credits:,
|
|
407
|
-
# The currency of the ledger account.
|
|
408
|
-
currency:,
|
|
409
|
-
# The currency exponent of the ledger account.
|
|
410
|
-
currency_exponent:,
|
|
411
|
-
debits:
|
|
412
|
-
)
|
|
413
|
-
end
|
|
414
|
-
|
|
415
|
-
sig do
|
|
416
|
-
override.returns(
|
|
417
|
-
{
|
|
418
|
-
amount: Integer,
|
|
419
|
-
credits: Integer,
|
|
420
|
-
currency: String,
|
|
421
|
-
currency_exponent: Integer,
|
|
422
|
-
debits: Integer
|
|
423
|
-
}
|
|
424
|
-
)
|
|
425
|
-
end
|
|
426
|
-
def to_hash
|
|
427
|
-
end
|
|
428
|
-
end
|
|
429
|
-
|
|
430
|
-
class PostedBalance < ModernTreasury::Internal::Type::BaseModel
|
|
431
|
-
OrHash =
|
|
432
|
-
T.type_alias do
|
|
433
|
-
T.any(
|
|
434
|
-
ModernTreasury::LedgerEntry::ResultingLedgerAccountBalances::PostedBalance,
|
|
435
|
-
ModernTreasury::Internal::AnyHash
|
|
436
|
-
)
|
|
437
|
-
end
|
|
438
|
-
|
|
439
|
-
sig { returns(Integer) }
|
|
440
|
-
attr_accessor :amount
|
|
441
|
-
|
|
442
|
-
sig { returns(Integer) }
|
|
443
|
-
attr_accessor :credits
|
|
444
|
-
|
|
445
|
-
# The currency of the ledger account.
|
|
446
|
-
sig { returns(String) }
|
|
447
|
-
attr_accessor :currency
|
|
448
|
-
|
|
449
|
-
# The currency exponent of the ledger account.
|
|
450
|
-
sig { returns(Integer) }
|
|
451
|
-
attr_accessor :currency_exponent
|
|
452
|
-
|
|
453
|
-
sig { returns(Integer) }
|
|
454
|
-
attr_accessor :debits
|
|
455
|
-
|
|
456
|
-
# The posted_balance is the sum of all posted entries.
|
|
457
|
-
sig do
|
|
458
|
-
params(
|
|
459
|
-
amount: Integer,
|
|
460
|
-
credits: Integer,
|
|
461
|
-
currency: String,
|
|
462
|
-
currency_exponent: Integer,
|
|
463
|
-
debits: Integer
|
|
464
|
-
).returns(T.attached_class)
|
|
465
|
-
end
|
|
466
|
-
def self.new(
|
|
467
|
-
amount:,
|
|
468
|
-
credits:,
|
|
469
|
-
# The currency of the ledger account.
|
|
470
|
-
currency:,
|
|
471
|
-
# The currency exponent of the ledger account.
|
|
472
|
-
currency_exponent:,
|
|
473
|
-
debits:
|
|
474
|
-
)
|
|
475
|
-
end
|
|
476
|
-
|
|
477
|
-
sig do
|
|
478
|
-
override.returns(
|
|
479
|
-
{
|
|
480
|
-
amount: Integer,
|
|
481
|
-
credits: Integer,
|
|
482
|
-
currency: String,
|
|
483
|
-
currency_exponent: Integer,
|
|
484
|
-
debits: Integer
|
|
485
|
-
}
|
|
486
|
-
)
|
|
487
|
-
end
|
|
488
|
-
def to_hash
|
|
489
|
-
end
|
|
490
|
-
end
|
|
491
|
-
end
|
|
492
|
-
|
|
493
188
|
# Equal to the state of the ledger transaction when the ledger entry was created.
|
|
494
189
|
# One of `pending`, `posted`, or `archived`.
|
|
495
190
|
module Status
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ModernTreasury
|
|
4
|
+
module Models
|
|
5
|
+
class LedgerEntryCreateRequest < ModernTreasury::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
ModernTreasury::LedgerEntryCreateRequest,
|
|
10
|
+
ModernTreasury::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Value in specified currency's smallest unit. e.g. $10 would be represented
|
|
15
|
+
# as 1000. Can be any integer up to 36 digits.
|
|
16
|
+
sig { returns(Integer) }
|
|
17
|
+
attr_accessor :amount
|
|
18
|
+
|
|
19
|
+
# One of `credit`, `debit`. Describes the direction money is flowing in the
|
|
20
|
+
# transaction. A `credit` moves money from your account to someone else's. A
|
|
21
|
+
# `debit` pulls money from someone else's account to your own. Note that wire,
|
|
22
|
+
# rtp, and check payments will always be `credit`.
|
|
23
|
+
sig { returns(ModernTreasury::TransactionDirection::OrSymbol) }
|
|
24
|
+
attr_accessor :direction
|
|
25
|
+
|
|
26
|
+
# The ledger account that this ledger entry is associated with.
|
|
27
|
+
sig { returns(String) }
|
|
28
|
+
attr_accessor :ledger_account_id
|
|
29
|
+
|
|
30
|
+
# Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
|
|
31
|
+
# account’s available balance. If any of these conditions would be false after the
|
|
32
|
+
# transaction is created, the entire call will fail with error code 422.
|
|
33
|
+
sig { returns(T.nilable(T::Hash[Symbol, Integer])) }
|
|
34
|
+
attr_accessor :available_balance_amount
|
|
35
|
+
|
|
36
|
+
# Lock version of the ledger account. This can be passed when creating a ledger
|
|
37
|
+
# transaction to only succeed if no ledger transactions have posted since the
|
|
38
|
+
# given version. See our post about Designing the Ledgers API with Optimistic
|
|
39
|
+
# Locking for more details.
|
|
40
|
+
sig { returns(T.nilable(Integer)) }
|
|
41
|
+
attr_accessor :lock_version
|
|
42
|
+
|
|
43
|
+
# Additional data represented as key-value pairs. Both the key and value must be
|
|
44
|
+
# strings.
|
|
45
|
+
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
46
|
+
attr_reader :metadata
|
|
47
|
+
|
|
48
|
+
sig { params(metadata: T::Hash[Symbol, String]).void }
|
|
49
|
+
attr_writer :metadata
|
|
50
|
+
|
|
51
|
+
# Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
|
|
52
|
+
# account’s pending balance. If any of these conditions would be false after the
|
|
53
|
+
# transaction is created, the entire call will fail with error code 422.
|
|
54
|
+
sig { returns(T.nilable(T::Hash[Symbol, Integer])) }
|
|
55
|
+
attr_accessor :pending_balance_amount
|
|
56
|
+
|
|
57
|
+
# Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
|
|
58
|
+
# account’s posted balance. If any of these conditions would be false after the
|
|
59
|
+
# transaction is created, the entire call will fail with error code 422.
|
|
60
|
+
sig { returns(T.nilable(T::Hash[Symbol, Integer])) }
|
|
61
|
+
attr_accessor :posted_balance_amount
|
|
62
|
+
|
|
63
|
+
# If true, response will include the balance of the associated ledger account for
|
|
64
|
+
# the entry.
|
|
65
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
66
|
+
attr_accessor :show_resulting_ledger_account_balances
|
|
67
|
+
|
|
68
|
+
sig do
|
|
69
|
+
params(
|
|
70
|
+
amount: Integer,
|
|
71
|
+
direction: ModernTreasury::TransactionDirection::OrSymbol,
|
|
72
|
+
ledger_account_id: String,
|
|
73
|
+
available_balance_amount: T.nilable(T::Hash[Symbol, Integer]),
|
|
74
|
+
lock_version: T.nilable(Integer),
|
|
75
|
+
metadata: T::Hash[Symbol, String],
|
|
76
|
+
pending_balance_amount: T.nilable(T::Hash[Symbol, Integer]),
|
|
77
|
+
posted_balance_amount: T.nilable(T::Hash[Symbol, Integer]),
|
|
78
|
+
show_resulting_ledger_account_balances: T.nilable(T::Boolean)
|
|
79
|
+
).returns(T.attached_class)
|
|
80
|
+
end
|
|
81
|
+
def self.new(
|
|
82
|
+
# Value in specified currency's smallest unit. e.g. $10 would be represented
|
|
83
|
+
# as 1000. Can be any integer up to 36 digits.
|
|
84
|
+
amount:,
|
|
85
|
+
# One of `credit`, `debit`. Describes the direction money is flowing in the
|
|
86
|
+
# transaction. A `credit` moves money from your account to someone else's. A
|
|
87
|
+
# `debit` pulls money from someone else's account to your own. Note that wire,
|
|
88
|
+
# rtp, and check payments will always be `credit`.
|
|
89
|
+
direction:,
|
|
90
|
+
# The ledger account that this ledger entry is associated with.
|
|
91
|
+
ledger_account_id:,
|
|
92
|
+
# Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
|
|
93
|
+
# account’s available balance. If any of these conditions would be false after the
|
|
94
|
+
# transaction is created, the entire call will fail with error code 422.
|
|
95
|
+
available_balance_amount: nil,
|
|
96
|
+
# Lock version of the ledger account. This can be passed when creating a ledger
|
|
97
|
+
# transaction to only succeed if no ledger transactions have posted since the
|
|
98
|
+
# given version. See our post about Designing the Ledgers API with Optimistic
|
|
99
|
+
# Locking for more details.
|
|
100
|
+
lock_version: nil,
|
|
101
|
+
# Additional data represented as key-value pairs. Both the key and value must be
|
|
102
|
+
# strings.
|
|
103
|
+
metadata: nil,
|
|
104
|
+
# Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
|
|
105
|
+
# account’s pending balance. If any of these conditions would be false after the
|
|
106
|
+
# transaction is created, the entire call will fail with error code 422.
|
|
107
|
+
pending_balance_amount: nil,
|
|
108
|
+
# Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
|
|
109
|
+
# account’s posted balance. If any of these conditions would be false after the
|
|
110
|
+
# transaction is created, the entire call will fail with error code 422.
|
|
111
|
+
posted_balance_amount: nil,
|
|
112
|
+
# If true, response will include the balance of the associated ledger account for
|
|
113
|
+
# the entry.
|
|
114
|
+
show_resulting_ledger_account_balances: nil
|
|
115
|
+
)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
sig do
|
|
119
|
+
override.returns(
|
|
120
|
+
{
|
|
121
|
+
amount: Integer,
|
|
122
|
+
direction: ModernTreasury::TransactionDirection::OrSymbol,
|
|
123
|
+
ledger_account_id: String,
|
|
124
|
+
available_balance_amount: T.nilable(T::Hash[Symbol, Integer]),
|
|
125
|
+
lock_version: T.nilable(Integer),
|
|
126
|
+
metadata: T::Hash[Symbol, String],
|
|
127
|
+
pending_balance_amount: T.nilable(T::Hash[Symbol, Integer]),
|
|
128
|
+
posted_balance_amount: T.nilable(T::Hash[Symbol, Integer]),
|
|
129
|
+
show_resulting_ledger_account_balances: T.nilable(T::Boolean)
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
end
|
|
133
|
+
def to_hash
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
end
|