modern_treasury 0.11.0 → 0.13.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.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +50 -0
  3. data/README.md +16 -7
  4. data/lib/modern_treasury/internal/transport/pooled_net_requester.rb +12 -10
  5. data/lib/modern_treasury/internal/util.rb +7 -2
  6. data/lib/modern_treasury/models/bulk_request_create_params.rb +146 -2
  7. data/lib/modern_treasury/models/child_legal_entity.rb +609 -0
  8. data/lib/modern_treasury/models/child_legal_entity_create.rb +63 -1
  9. data/lib/modern_treasury/models/connection_legal_entity.rb +2 -0
  10. data/lib/modern_treasury/models/connection_legal_entity_create_params.rb +54 -63
  11. data/lib/modern_treasury/models/connection_legal_entity_list_params.rb +2 -0
  12. data/lib/modern_treasury/models/counterparty_create_params.rb +54 -59
  13. data/lib/modern_treasury/models/document.rb +8 -7
  14. data/lib/modern_treasury/models/document_create_params.rb +16 -15
  15. data/lib/modern_treasury/models/document_list_params.rb +2 -1
  16. data/lib/modern_treasury/models/expected_payment.rb +69 -1
  17. data/lib/modern_treasury/models/expected_payment_create_params.rb +65 -1
  18. data/lib/modern_treasury/models/expected_payment_update_params.rb +65 -1
  19. data/lib/modern_treasury/models/incoming_payment_detail.rb +5 -0
  20. data/lib/modern_treasury/models/incoming_payment_detail_create_async_params.rb +5 -0
  21. data/lib/modern_treasury/models/incoming_payment_detail_list_params.rb +5 -0
  22. data/lib/modern_treasury/models/internal_account.rb +10 -1
  23. data/lib/modern_treasury/models/internal_account_update_params.rb +9 -1
  24. data/lib/modern_treasury/models/invoice.rb +2 -0
  25. data/lib/modern_treasury/models/invoice_create_params.rb +1 -19
  26. data/lib/modern_treasury/models/invoice_update_params.rb +1 -19
  27. data/lib/modern_treasury/models/ledger_entry.rb +10 -1
  28. data/lib/modern_treasury/models/ledger_entry_create_request.rb +10 -1
  29. data/lib/modern_treasury/models/ledger_transactions/ledger_transaction_version.rb +10 -1
  30. data/lib/modern_treasury/models/legal_entity.rb +61 -11
  31. data/lib/modern_treasury/models/legal_entity_association.rb +3 -559
  32. data/lib/modern_treasury/models/legal_entity_association_inline_create.rb +60 -0
  33. data/lib/modern_treasury/models/legal_entity_create_params.rb +54 -59
  34. data/lib/modern_treasury/models/legal_entity_update_params.rb +51 -1
  35. data/lib/modern_treasury/models/payment_order.rb +4 -0
  36. data/lib/modern_treasury/models/payment_order_create_params.rb +17 -16
  37. data/lib/modern_treasury/models/payment_reference.rb +4 -0
  38. data/lib/modern_treasury/models/return_object.rb +6 -0
  39. data/lib/modern_treasury/models/transaction.rb +1 -0
  40. data/lib/modern_treasury/models.rb +4 -0
  41. data/lib/modern_treasury/resources/account_details.rb +4 -4
  42. data/lib/modern_treasury/resources/documents.rb +5 -5
  43. data/lib/modern_treasury/resources/expected_payments.rb +18 -2
  44. data/lib/modern_treasury/resources/internal_accounts.rb +3 -1
  45. data/lib/modern_treasury/resources/invoices.rb +2 -10
  46. data/lib/modern_treasury/resources/ledger_accounts.rb +3 -3
  47. data/lib/modern_treasury/resources/ledger_transactions.rb +5 -2
  48. data/lib/modern_treasury/resources/legal_entities.rb +27 -3
  49. data/lib/modern_treasury/resources/line_items.rb +2 -2
  50. data/lib/modern_treasury/resources/routing_details.rb +4 -4
  51. data/lib/modern_treasury/version.rb +1 -1
  52. data/lib/modern_treasury.rb +3 -0
  53. data/manifest.yaml +1 -0
  54. data/rbi/modern_treasury/models/bulk_request_create_params.rbi +272 -0
  55. data/rbi/modern_treasury/models/child_legal_entity.rbi +969 -0
  56. data/rbi/modern_treasury/models/child_legal_entity_create.rbi +78 -0
  57. data/rbi/modern_treasury/models/connection_legal_entity.rbi +10 -0
  58. data/rbi/modern_treasury/models/connection_legal_entity_create_params.rbi +61 -135
  59. data/rbi/modern_treasury/models/connection_legal_entity_list_params.rbi +10 -0
  60. data/rbi/modern_treasury/models/counterparty_create_params.rbi +61 -135
  61. data/rbi/modern_treasury/models/document.rbi +22 -11
  62. data/rbi/modern_treasury/models/document_create_params.rbi +41 -23
  63. data/rbi/modern_treasury/models/document_list_params.rbi +10 -5
  64. data/rbi/modern_treasury/models/expected_payment.rbi +136 -0
  65. data/rbi/modern_treasury/models/expected_payment_create_params.rbi +136 -0
  66. data/rbi/modern_treasury/models/expected_payment_update_params.rbi +136 -0
  67. data/rbi/modern_treasury/models/incoming_payment_detail.rbi +25 -0
  68. data/rbi/modern_treasury/models/incoming_payment_detail_create_async_params.rbi +25 -0
  69. data/rbi/modern_treasury/models/incoming_payment_detail_list_params.rbi +25 -0
  70. data/rbi/modern_treasury/models/internal_account.rbi +10 -0
  71. data/rbi/modern_treasury/models/internal_account_update_params.rbi +11 -0
  72. data/rbi/modern_treasury/models/invoice_create_params.rbi +0 -20
  73. data/rbi/modern_treasury/models/invoice_update_params.rbi +0 -20
  74. data/rbi/modern_treasury/models/ledger_entry.rbi +10 -0
  75. data/rbi/modern_treasury/models/ledger_entry_create_request.rbi +13 -0
  76. data/rbi/modern_treasury/models/ledger_transactions/ledger_transaction_version.rbi +10 -0
  77. data/rbi/modern_treasury/models/legal_entity.rbi +67 -15
  78. data/rbi/modern_treasury/models/legal_entity_association.rbi +4 -962
  79. data/rbi/modern_treasury/models/legal_entity_association_inline_create.rbi +130 -0
  80. data/rbi/modern_treasury/models/legal_entity_create_params.rbi +61 -134
  81. data/rbi/modern_treasury/models/legal_entity_update_params.rbi +58 -0
  82. data/rbi/modern_treasury/models/payment_order.rbi +20 -0
  83. data/rbi/modern_treasury/models/payment_order_create_params.rbi +44 -26
  84. data/rbi/modern_treasury/models/payment_reference.rbi +20 -0
  85. data/rbi/modern_treasury/models/return_object.rbi +24 -0
  86. data/rbi/modern_treasury/models/transaction.rbi +5 -0
  87. data/rbi/modern_treasury/models.rbi +5 -0
  88. data/rbi/modern_treasury/resources/account_details.rbi +4 -4
  89. data/rbi/modern_treasury/resources/documents.rbi +5 -5
  90. data/rbi/modern_treasury/resources/expected_payments.rbi +44 -0
  91. data/rbi/modern_treasury/resources/internal_accounts.rbi +3 -0
  92. data/rbi/modern_treasury/resources/invoices.rbi +0 -16
  93. data/rbi/modern_treasury/resources/ledger_accounts.rbi +3 -3
  94. data/rbi/modern_treasury/resources/ledger_transactions.rbi +3 -2
  95. data/rbi/modern_treasury/resources/legal_entities.rbi +41 -1
  96. data/rbi/modern_treasury/resources/line_items.rbi +2 -2
  97. data/rbi/modern_treasury/resources/routing_details.rbi +4 -4
  98. data/sig/modern_treasury/models/bulk_request_create_params.rbs +84 -0
  99. data/sig/modern_treasury/models/child_legal_entity.rbs +469 -0
  100. data/sig/modern_treasury/models/child_legal_entity_create.rbs +39 -0
  101. data/sig/modern_treasury/models/connection_legal_entity.rbs +4 -1
  102. data/sig/modern_treasury/models/connection_legal_entity_create_params.rbs +38 -60
  103. data/sig/modern_treasury/models/connection_legal_entity_list_params.rbs +4 -1
  104. data/sig/modern_treasury/models/counterparty_create_params.rbs +38 -60
  105. data/sig/modern_treasury/models/document.rbs +13 -11
  106. data/sig/modern_treasury/models/document_create_params.rbs +22 -14
  107. data/sig/modern_treasury/models/document_list_params.rbs +5 -3
  108. data/sig/modern_treasury/models/expected_payment.rbs +42 -0
  109. data/sig/modern_treasury/models/expected_payment_create_params.rbs +42 -0
  110. data/sig/modern_treasury/models/expected_payment_update_params.rbs +42 -0
  111. data/sig/modern_treasury/models/incoming_payment_detail.rbs +10 -0
  112. data/sig/modern_treasury/models/incoming_payment_detail_create_async_params.rbs +10 -0
  113. data/sig/modern_treasury/models/incoming_payment_detail_list_params.rbs +10 -0
  114. data/sig/modern_treasury/models/internal_account.rbs +5 -0
  115. data/sig/modern_treasury/models/internal_account_update_params.rbs +7 -0
  116. data/sig/modern_treasury/models/invoice_create_params.rbs +0 -10
  117. data/sig/modern_treasury/models/invoice_update_params.rbs +0 -10
  118. data/sig/modern_treasury/models/ledger_entry.rbs +5 -0
  119. data/sig/modern_treasury/models/ledger_entry_create_request.rbs +7 -0
  120. data/sig/modern_treasury/models/ledger_transactions/ledger_transaction_version.rbs +5 -0
  121. data/sig/modern_treasury/models/legal_entity.rbs +38 -8
  122. data/sig/modern_treasury/models/legal_entity_association.rbs +4 -435
  123. data/sig/modern_treasury/models/legal_entity_association_inline_create.rbs +59 -0
  124. data/sig/modern_treasury/models/legal_entity_create_params.rbs +38 -60
  125. data/sig/modern_treasury/models/legal_entity_update_params.rbs +34 -0
  126. data/sig/modern_treasury/models/payment_order.rbs +8 -0
  127. data/sig/modern_treasury/models/payment_order_create_params.rbs +24 -16
  128. data/sig/modern_treasury/models/payment_reference.rbs +8 -0
  129. data/sig/modern_treasury/models/return_object.rbs +18 -1
  130. data/sig/modern_treasury/models/transaction.rbs +2 -0
  131. data/sig/modern_treasury/models.rbs +4 -0
  132. data/sig/modern_treasury/resources/documents.rbs +2 -2
  133. data/sig/modern_treasury/resources/expected_payments.rbs +8 -0
  134. data/sig/modern_treasury/resources/internal_accounts.rbs +1 -0
  135. data/sig/modern_treasury/resources/invoices.rbs +0 -4
  136. data/sig/modern_treasury/resources/legal_entities.rbs +13 -1
  137. metadata +22 -2
@@ -40,6 +40,11 @@ module ModernTreasury
40
40
  sig { params(connection: ModernTreasury::Connection::OrHash).void }
41
41
  attr_writer :connection
42
42
 
43
+ # If the internal account links to a contra ledger account in Modern Treasury, the
44
+ # id of the contra ledger account will be populated here.
45
+ sig { returns(T.nilable(String)) }
46
+ attr_accessor :contra_ledger_account_id
47
+
43
48
  # The Counterparty associated to this account.
44
49
  sig { returns(T.nilable(String)) }
45
50
  attr_accessor :counterparty_id
@@ -132,6 +137,7 @@ module ModernTreasury
132
137
  account_type:
133
138
  T.nilable(ModernTreasury::InternalAccount::AccountType::OrSymbol),
134
139
  connection: ModernTreasury::Connection::OrHash,
140
+ contra_ledger_account_id: T.nilable(String),
135
141
  counterparty_id: T.nilable(String),
136
142
  created_at: Time,
137
143
  currency: ModernTreasury::Currency::OrSymbol,
@@ -163,6 +169,9 @@ module ModernTreasury
163
169
  account_type:,
164
170
  # Specifies which financial institution the accounts belong to.
165
171
  connection:,
172
+ # If the internal account links to a contra ledger account in Modern Treasury, the
173
+ # id of the contra ledger account will be populated here.
174
+ contra_ledger_account_id:,
166
175
  # The Counterparty associated to this account.
167
176
  counterparty_id:,
168
177
  created_at:,
@@ -212,6 +221,7 @@ module ModernTreasury
212
221
  ModernTreasury::InternalAccount::AccountType::TaggedSymbol
213
222
  ),
214
223
  connection: ModernTreasury::Connection,
224
+ contra_ledger_account_id: T.nilable(String),
215
225
  counterparty_id: T.nilable(String),
216
226
  created_at: Time,
217
227
  currency: ModernTreasury::Currency::TaggedSymbol,
@@ -14,6 +14,13 @@ module ModernTreasury
14
14
  )
15
15
  end
16
16
 
17
+ # The Contra Ledger Account associated to this account.
18
+ sig { returns(T.nilable(String)) }
19
+ attr_reader :contra_ledger_account_id
20
+
21
+ sig { params(contra_ledger_account_id: String).void }
22
+ attr_writer :contra_ledger_account_id
23
+
17
24
  # The Counterparty associated to this account.
18
25
  sig { returns(T.nilable(String)) }
19
26
  attr_reader :counterparty_id
@@ -52,6 +59,7 @@ module ModernTreasury
52
59
 
53
60
  sig do
54
61
  params(
62
+ contra_ledger_account_id: String,
55
63
  counterparty_id: String,
56
64
  ledger_account_id: String,
57
65
  metadata: T::Hash[Symbol, String],
@@ -61,6 +69,8 @@ module ModernTreasury
61
69
  ).returns(T.attached_class)
62
70
  end
63
71
  def self.new(
72
+ # The Contra Ledger Account associated to this account.
73
+ contra_ledger_account_id: nil,
64
74
  # The Counterparty associated to this account.
65
75
  counterparty_id: nil,
66
76
  # The Ledger Account associated to this account.
@@ -79,6 +89,7 @@ module ModernTreasury
79
89
  sig do
80
90
  override.returns(
81
91
  {
92
+ contra_ledger_account_id: String,
82
93
  counterparty_id: String,
83
94
  ledger_account_id: String,
84
95
  metadata: T::Hash[Symbol, String],
@@ -102,12 +102,6 @@ module ModernTreasury
102
102
  sig { returns(T.nilable(String)) }
103
103
  attr_accessor :fallback_payment_method
104
104
 
105
- # Whether to ingest the ledger_entries to populate the invoice line items. If this
106
- # is false, then a line item must be provided. If this is true, line_items must be
107
- # empty. Ignored if ledger_account_settlement_id is empty.
108
- sig { returns(T.nilable(T::Boolean)) }
109
- attr_accessor :ingest_ledger_entries
110
-
111
105
  # An array of invoice line items. The API supports a maximum of 50 invoice line
112
106
  # items per invoice. If a greater number of invoice line items is required, please
113
107
  # contact support.
@@ -136,10 +130,6 @@ module ModernTreasury
136
130
  end
137
131
  attr_writer :invoicer_address
138
132
 
139
- # The ID of the virtual account the invoice should be paid to.
140
- sig { returns(T.nilable(String)) }
141
- attr_accessor :ledger_account_settlement_id
142
-
143
133
  # Additional data represented as key-value pairs. Both the key and value must be
144
134
  # strings.
145
135
  sig { returns(T.nilable(T::Hash[Symbol, String])) }
@@ -246,7 +236,6 @@ module ModernTreasury
246
236
  currency: ModernTreasury::Currency::OrSymbol,
247
237
  description: String,
248
238
  fallback_payment_method: T.nilable(String),
249
- ingest_ledger_entries: T.nilable(T::Boolean),
250
239
  invoice_line_items:
251
240
  T.nilable(
252
241
  T::Array[
@@ -257,7 +246,6 @@ module ModernTreasury
257
246
  T.nilable(
258
247
  ModernTreasury::InvoiceCreateParams::InvoicerAddress::OrHash
259
248
  ),
260
- ledger_account_settlement_id: T.nilable(String),
261
249
  metadata: T.nilable(T::Hash[Symbol, String]),
262
250
  notification_email_addresses: T.nilable(T::Array[String]),
263
251
  notifications_enabled: T::Boolean,
@@ -297,18 +285,12 @@ module ModernTreasury
297
285
  # When payment_method is automatic, the fallback payment method to use when an
298
286
  # automatic payment fails. One of `manual` or `ui`.
299
287
  fallback_payment_method: nil,
300
- # Whether to ingest the ledger_entries to populate the invoice line items. If this
301
- # is false, then a line item must be provided. If this is true, line_items must be
302
- # empty. Ignored if ledger_account_settlement_id is empty.
303
- ingest_ledger_entries: nil,
304
288
  # An array of invoice line items. The API supports a maximum of 50 invoice line
305
289
  # items per invoice. If a greater number of invoice line items is required, please
306
290
  # contact support.
307
291
  invoice_line_items: nil,
308
292
  # The invoice issuer's business address.
309
293
  invoicer_address: nil,
310
- # The ID of the virtual account the invoice should be paid to.
311
- ledger_account_settlement_id: nil,
312
294
  # Additional data represented as key-value pairs. Both the key and value must be
313
295
  # strings.
314
296
  metadata: nil,
@@ -370,14 +352,12 @@ module ModernTreasury
370
352
  currency: ModernTreasury::Currency::OrSymbol,
371
353
  description: String,
372
354
  fallback_payment_method: T.nilable(String),
373
- ingest_ledger_entries: T.nilable(T::Boolean),
374
355
  invoice_line_items:
375
356
  T.nilable(
376
357
  T::Array[ModernTreasury::InvoiceCreateParams::InvoiceLineItem]
377
358
  ),
378
359
  invoicer_address:
379
360
  T.nilable(ModernTreasury::InvoiceCreateParams::InvoicerAddress),
380
- ledger_account_settlement_id: T.nilable(String),
381
361
  metadata: T.nilable(T::Hash[Symbol, String]),
382
362
  notification_email_addresses: T.nilable(T::Array[String]),
383
363
  notifications_enabled: T::Boolean,
@@ -98,12 +98,6 @@ module ModernTreasury
98
98
  sig { returns(T.nilable(String)) }
99
99
  attr_accessor :fallback_payment_method
100
100
 
101
- # Whether to ingest the ledger_entries to populate the invoice line items. If this
102
- # is false, then a line item must be provided. If this is true, line_items must be
103
- # empty. Ignored if ledger_account_settlement_id is empty.
104
- sig { returns(T.nilable(T::Boolean)) }
105
- attr_accessor :ingest_ledger_entries
106
-
107
101
  # An array of invoice line items. The API supports a maximum of 50 invoice line
108
102
  # items per invoice. If a greater number of invoice line items is required, please
109
103
  # contact support.
@@ -132,10 +126,6 @@ module ModernTreasury
132
126
  end
133
127
  attr_writer :invoicer_address
134
128
 
135
- # The ID of the virtual account the invoice should be paid to.
136
- sig { returns(T.nilable(String)) }
137
- attr_accessor :ledger_account_settlement_id
138
-
139
129
  # Additional data represented as key-value pairs. Both the key and value must be
140
130
  # strings.
141
131
  sig { returns(T.nilable(T::Hash[Symbol, String])) }
@@ -256,7 +246,6 @@ module ModernTreasury
256
246
  description: String,
257
247
  due_date: Time,
258
248
  fallback_payment_method: T.nilable(String),
259
- ingest_ledger_entries: T.nilable(T::Boolean),
260
249
  invoice_line_items:
261
250
  T.nilable(
262
251
  T::Array[
@@ -267,7 +256,6 @@ module ModernTreasury
267
256
  T.nilable(
268
257
  ModernTreasury::InvoiceUpdateParams::InvoicerAddress::OrHash
269
258
  ),
270
- ledger_account_settlement_id: T.nilable(String),
271
259
  metadata: T.nilable(T::Hash[Symbol, String]),
272
260
  notification_email_addresses: T.nilable(T::Array[String]),
273
261
  notifications_enabled: T::Boolean,
@@ -303,18 +291,12 @@ module ModernTreasury
303
291
  # When payment_method is automatic, the fallback payment method to use when an
304
292
  # automatic payment fails. One of `manual` or `ui`.
305
293
  fallback_payment_method: nil,
306
- # Whether to ingest the ledger_entries to populate the invoice line items. If this
307
- # is false, then a line item must be provided. If this is true, line_items must be
308
- # empty. Ignored if ledger_account_settlement_id is empty.
309
- ingest_ledger_entries: nil,
310
294
  # An array of invoice line items. The API supports a maximum of 50 invoice line
311
295
  # items per invoice. If a greater number of invoice line items is required, please
312
296
  # contact support.
313
297
  invoice_line_items: nil,
314
298
  # The invoice issuer's business address.
315
299
  invoicer_address: nil,
316
- # The ID of the virtual account the invoice should be paid to.
317
- ledger_account_settlement_id: nil,
318
300
  # Additional data represented as key-value pairs. Both the key and value must be
319
301
  # strings.
320
302
  metadata: nil,
@@ -380,14 +362,12 @@ module ModernTreasury
380
362
  description: String,
381
363
  due_date: Time,
382
364
  fallback_payment_method: T.nilable(String),
383
- ingest_ledger_entries: T.nilable(T::Boolean),
384
365
  invoice_line_items:
385
366
  T.nilable(
386
367
  T::Array[ModernTreasury::InvoiceUpdateParams::InvoiceLineItem]
387
368
  ),
388
369
  invoicer_address:
389
370
  T.nilable(ModernTreasury::InvoiceUpdateParams::InvoicerAddress),
390
- ledger_account_settlement_id: T.nilable(String),
391
371
  metadata: T.nilable(T::Hash[Symbol, String]),
392
372
  notification_email_addresses: T.nilable(T::Array[String]),
393
373
  notifications_enabled: T::Boolean,
@@ -29,6 +29,11 @@ module ModernTreasury
29
29
  sig { returns(T.nilable(Time)) }
30
30
  attr_accessor :discarded_at
31
31
 
32
+ # The timestamp (ISO8601 format) at which the ledger transaction happened for
33
+ # reporting purposes.
34
+ sig { returns(Time) }
35
+ attr_accessor :effective_at
36
+
32
37
  # The currency of the ledger account.
33
38
  sig { returns(String) }
34
39
  attr_accessor :ledger_account_currency
@@ -98,6 +103,7 @@ module ModernTreasury
98
103
  created_at: Time,
99
104
  direction: ModernTreasury::TransactionDirection::OrSymbol,
100
105
  discarded_at: T.nilable(Time),
106
+ effective_at: Time,
101
107
  ledger_account_currency: String,
102
108
  ledger_account_currency_exponent: Integer,
103
109
  ledger_account_id: String,
@@ -124,6 +130,9 @@ module ModernTreasury
124
130
  # rtp, and check payments will always be `credit`.
125
131
  direction:,
126
132
  discarded_at:,
133
+ # The timestamp (ISO8601 format) at which the ledger transaction happened for
134
+ # reporting purposes.
135
+ effective_at:,
127
136
  # The currency of the ledger account.
128
137
  ledger_account_currency:,
129
138
  # The currency exponent of the ledger account.
@@ -167,6 +176,7 @@ module ModernTreasury
167
176
  created_at: Time,
168
177
  direction: ModernTreasury::TransactionDirection::TaggedSymbol,
169
178
  discarded_at: T.nilable(Time),
179
+ effective_at: Time,
170
180
  ledger_account_currency: String,
171
181
  ledger_account_currency_exponent: Integer,
172
182
  ledger_account_id: String,
@@ -33,6 +33,14 @@ module ModernTreasury
33
33
  sig { returns(T.nilable(T::Hash[Symbol, Integer])) }
34
34
  attr_accessor :available_balance_amount
35
35
 
36
+ # The timestamp (ISO8601 format) at which the ledger transaction happened for
37
+ # reporting purposes.
38
+ sig { returns(T.nilable(Time)) }
39
+ attr_reader :effective_at
40
+
41
+ sig { params(effective_at: Time).void }
42
+ attr_writer :effective_at
43
+
36
44
  # Lock version of the ledger account. This can be passed when creating a ledger
37
45
  # transaction to only succeed if no ledger transactions have posted since the
38
46
  # given version. See our post about Designing the Ledgers API with Optimistic
@@ -71,6 +79,7 @@ module ModernTreasury
71
79
  direction: ModernTreasury::TransactionDirection::OrSymbol,
72
80
  ledger_account_id: String,
73
81
  available_balance_amount: T.nilable(T::Hash[Symbol, Integer]),
82
+ effective_at: Time,
74
83
  lock_version: T.nilable(Integer),
75
84
  metadata: T::Hash[Symbol, String],
76
85
  pending_balance_amount: T.nilable(T::Hash[Symbol, Integer]),
@@ -93,6 +102,9 @@ module ModernTreasury
93
102
  # account’s available balance. If any of these conditions would be false after the
94
103
  # transaction is created, the entire call will fail with error code 422.
95
104
  available_balance_amount: nil,
105
+ # The timestamp (ISO8601 format) at which the ledger transaction happened for
106
+ # reporting purposes.
107
+ effective_at: nil,
96
108
  # Lock version of the ledger account. This can be passed when creating a ledger
97
109
  # transaction to only succeed if no ledger transactions have posted since the
98
110
  # given version. See our post about Designing the Ledgers API with Optimistic
@@ -122,6 +134,7 @@ module ModernTreasury
122
134
  direction: ModernTreasury::TransactionDirection::OrSymbol,
123
135
  ledger_account_id: String,
124
136
  available_balance_amount: T.nilable(T::Hash[Symbol, Integer]),
137
+ effective_at: Time,
125
138
  lock_version: T.nilable(Integer),
126
139
  metadata: T::Hash[Symbol, String],
127
140
  pending_balance_amount: T.nilable(T::Hash[Symbol, Integer]),
@@ -276,6 +276,11 @@ module ModernTreasury
276
276
  sig { returns(ModernTreasury::TransactionDirection::TaggedSymbol) }
277
277
  attr_accessor :direction
278
278
 
279
+ # The timestamp (ISO8601 format) at which the ledger transaction happened for
280
+ # reporting purposes.
281
+ sig { returns(Time) }
282
+ attr_accessor :effective_at
283
+
279
284
  # The currency of the ledger account.
280
285
  sig { returns(String) }
281
286
  attr_accessor :ledger_account_currency
@@ -345,6 +350,7 @@ module ModernTreasury
345
350
  amount: Integer,
346
351
  created_at: Time,
347
352
  direction: ModernTreasury::TransactionDirection::OrSymbol,
353
+ effective_at: Time,
348
354
  ledger_account_currency: String,
349
355
  ledger_account_currency_exponent: Integer,
350
356
  ledger_account_id: String,
@@ -370,6 +376,9 @@ module ModernTreasury
370
376
  # `debit` pulls money from someone else's account to your own. Note that wire,
371
377
  # rtp, and check payments will always be `credit`.
372
378
  direction:,
379
+ # The timestamp (ISO8601 format) at which the ledger transaction happened for
380
+ # reporting purposes.
381
+ effective_at:,
373
382
  # The currency of the ledger account.
374
383
  ledger_account_currency:,
375
384
  # The currency exponent of the ledger account.
@@ -411,6 +420,7 @@ module ModernTreasury
411
420
  amount: Integer,
412
421
  created_at: Time,
413
422
  direction: ModernTreasury::TransactionDirection::TaggedSymbol,
423
+ effective_at: Time,
414
424
  ledger_account_currency: String,
415
425
  ledger_account_currency_exponent: Integer,
416
426
  ledger_account_id: String,
@@ -26,6 +26,10 @@ module ModernTreasury
26
26
  end
27
27
  attr_writer :bank_settings
28
28
 
29
+ # A description of the business.
30
+ sig { returns(T.nilable(String)) }
31
+ attr_accessor :business_description
32
+
29
33
  # The business's legal business name.
30
34
  sig { returns(T.nilable(String)) }
31
35
  attr_accessor :business_name
@@ -45,6 +49,11 @@ module ModernTreasury
45
49
  end
46
50
  attr_writer :compliance_details
47
51
 
52
+ # The country code where the business is incorporated in the ISO 3166-1 alpha-2 or
53
+ # alpha-3 formats.
54
+ sig { returns(T.nilable(String)) }
55
+ attr_accessor :country_of_incorporation
56
+
48
57
  sig { returns(Time) }
49
58
  attr_accessor :created_at
50
59
 
@@ -66,6 +75,10 @@ module ModernTreasury
66
75
  sig { returns(T.nilable(String)) }
67
76
  attr_accessor :email
68
77
 
78
+ # Monthly expected transaction volume in entity's local currency.
79
+ sig { returns(T.nilable(Integer)) }
80
+ attr_accessor :expected_activity_volume
81
+
69
82
  # An individual's first name.
70
83
  sig { returns(T.nilable(String)) }
71
84
  attr_accessor :first_name
@@ -80,16 +93,14 @@ module ModernTreasury
80
93
  end
81
94
  attr_accessor :industry_classifications
82
95
 
96
+ # A description of the intended use of the legal entity.
97
+ sig { returns(T.nilable(String)) }
98
+ attr_accessor :intended_use
99
+
83
100
  # An individual's last name.
84
101
  sig { returns(T.nilable(String)) }
85
102
  attr_accessor :last_name
86
103
 
87
- # The legal entity associations and its child legal entities.
88
- sig do
89
- returns(T.nilable(T::Array[ModernTreasury::LegalEntityAssociation]))
90
- end
91
- attr_accessor :legal_entity_associations
92
-
93
104
  # The type of legal entity.
94
105
  sig do
95
106
  returns(ModernTreasury::LegalEntity::LegalEntityType::TaggedSymbol)
@@ -121,6 +132,11 @@ module ModernTreasury
121
132
  sig { returns(String) }
122
133
  attr_accessor :object
123
134
 
135
+ # A list of countries where the business operates (ISO 3166-1 alpha-2 or alpha-3
136
+ # codes).
137
+ sig { returns(T::Array[String]) }
138
+ attr_accessor :operating_jurisdictions
139
+
124
140
  sig { returns(T::Array[ModernTreasury::LegalEntity::PhoneNumber]) }
125
141
  attr_accessor :phone_numbers
126
142
 
@@ -136,6 +152,10 @@ module ModernTreasury
136
152
  sig { returns(T.nilable(String)) }
137
153
  attr_accessor :prefix
138
154
 
155
+ # A list of primary social media URLs for the business.
156
+ sig { returns(T::Array[String]) }
157
+ attr_accessor :primary_social_media_sites
158
+
139
159
  # The risk rating of the legal entity. One of low, medium, high.
140
160
  sig do
141
161
  returns(
@@ -168,30 +188,38 @@ module ModernTreasury
168
188
  sig { returns(T.nilable(String)) }
169
189
  attr_accessor :website
170
190
 
191
+ # The legal entity associations and its child legal entities.
192
+ sig do
193
+ returns(T.nilable(T::Array[ModernTreasury::LegalEntityAssociation]))
194
+ end
195
+ attr_accessor :legal_entity_associations
196
+
171
197
  sig do
172
198
  params(
173
199
  id: String,
174
200
  addresses: T::Array[ModernTreasury::LegalEntity::Address::OrHash],
175
201
  bank_settings:
176
202
  T.nilable(ModernTreasury::LegalEntityBankSettings::OrHash),
203
+ business_description: T.nilable(String),
177
204
  business_name: T.nilable(String),
178
205
  citizenship_country: T.nilable(String),
179
206
  compliance_details:
180
207
  T.nilable(ModernTreasury::LegalEntityComplianceDetail::OrHash),
208
+ country_of_incorporation: T.nilable(String),
181
209
  created_at: Time,
182
210
  date_formed: T.nilable(Date),
183
211
  date_of_birth: T.nilable(Date),
184
212
  discarded_at: T.nilable(Time),
185
213
  doing_business_as_names: T::Array[String],
186
214
  email: T.nilable(String),
215
+ expected_activity_volume: T.nilable(Integer),
187
216
  first_name: T.nilable(String),
188
217
  identifications:
189
218
  T::Array[ModernTreasury::LegalEntity::Identification::OrHash],
190
219
  industry_classifications:
191
220
  T::Array[ModernTreasury::LegalEntityIndustryClassification::OrHash],
221
+ intended_use: T.nilable(String),
192
222
  last_name: T.nilable(String),
193
- legal_entity_associations:
194
- T.nilable(T::Array[ModernTreasury::LegalEntityAssociation::OrHash]),
195
223
  legal_entity_type:
196
224
  ModernTreasury::LegalEntity::LegalEntityType::OrSymbol,
197
225
  legal_structure:
@@ -200,11 +228,13 @@ module ModernTreasury
200
228
  metadata: T::Hash[Symbol, String],
201
229
  middle_name: T.nilable(String),
202
230
  object: String,
231
+ operating_jurisdictions: T::Array[String],
203
232
  phone_numbers:
204
233
  T::Array[ModernTreasury::LegalEntity::PhoneNumber::OrHash],
205
234
  politically_exposed_person: T.nilable(T::Boolean),
206
235
  preferred_name: T.nilable(String),
207
236
  prefix: T.nilable(String),
237
+ primary_social_media_sites: T::Array[String],
208
238
  risk_rating:
209
239
  T.nilable(ModernTreasury::LegalEntity::RiskRating::OrSymbol),
210
240
  suffix: T.nilable(String),
@@ -213,7 +243,9 @@ module ModernTreasury
213
243
  T.nilable(
214
244
  ModernTreasury::LegalEntityWealthEmploymentDetail::OrHash
215
245
  ),
216
- website: T.nilable(String)
246
+ website: T.nilable(String),
247
+ legal_entity_associations:
248
+ T.nilable(T::Array[ModernTreasury::LegalEntityAssociation::OrHash])
217
249
  ).returns(T.attached_class)
218
250
  end
219
251
  def self.new(
@@ -221,11 +253,16 @@ module ModernTreasury
221
253
  # A list of addresses for the entity.
222
254
  addresses:,
223
255
  bank_settings:,
256
+ # A description of the business.
257
+ business_description:,
224
258
  # The business's legal business name.
225
259
  business_name:,
226
260
  # The country of citizenship for an individual.
227
261
  citizenship_country:,
228
262
  compliance_details:,
263
+ # The country code where the business is incorporated in the ISO 3166-1 alpha-2 or
264
+ # alpha-3 formats.
265
+ country_of_incorporation:,
229
266
  created_at:,
230
267
  # A business's formation date (YYYY-MM-DD).
231
268
  date_formed:,
@@ -235,16 +272,18 @@ module ModernTreasury
235
272
  doing_business_as_names:,
236
273
  # The entity's primary email.
237
274
  email:,
275
+ # Monthly expected transaction volume in entity's local currency.
276
+ expected_activity_volume:,
238
277
  # An individual's first name.
239
278
  first_name:,
240
279
  # A list of identifications for the legal entity.
241
280
  identifications:,
242
281
  # A list of industry classifications for the legal entity.
243
282
  industry_classifications:,
283
+ # A description of the intended use of the legal entity.
284
+ intended_use:,
244
285
  # An individual's last name.
245
286
  last_name:,
246
- # The legal entity associations and its child legal entities.
247
- legal_entity_associations:,
248
287
  # The type of legal entity.
249
288
  legal_entity_type:,
250
289
  # The business's legal structure.
@@ -258,6 +297,9 @@ module ModernTreasury
258
297
  # An individual's middle name.
259
298
  middle_name:,
260
299
  object:,
300
+ # A list of countries where the business operates (ISO 3166-1 alpha-2 or alpha-3
301
+ # codes).
302
+ operating_jurisdictions:,
261
303
  phone_numbers:,
262
304
  # Whether the individual is a politically exposed person.
263
305
  politically_exposed_person:,
@@ -265,6 +307,8 @@ module ModernTreasury
265
307
  preferred_name:,
266
308
  # An individual's prefix.
267
309
  prefix:,
310
+ # A list of primary social media URLs for the business.
311
+ primary_social_media_sites:,
268
312
  # The risk rating of the legal entity. One of low, medium, high.
269
313
  risk_rating:,
270
314
  # An individual's suffix.
@@ -272,7 +316,9 @@ module ModernTreasury
272
316
  updated_at:,
273
317
  wealth_and_employment_details:,
274
318
  # The entity's primary website URL.
275
- website:
319
+ website:,
320
+ # The legal entity associations and its child legal entities.
321
+ legal_entity_associations: nil
276
322
  )
277
323
  end
278
324
 
@@ -282,24 +328,26 @@ module ModernTreasury
282
328
  id: String,
283
329
  addresses: T::Array[ModernTreasury::LegalEntity::Address],
284
330
  bank_settings: T.nilable(ModernTreasury::LegalEntityBankSettings),
331
+ business_description: T.nilable(String),
285
332
  business_name: T.nilable(String),
286
333
  citizenship_country: T.nilable(String),
287
334
  compliance_details:
288
335
  T.nilable(ModernTreasury::LegalEntityComplianceDetail),
336
+ country_of_incorporation: T.nilable(String),
289
337
  created_at: Time,
290
338
  date_formed: T.nilable(Date),
291
339
  date_of_birth: T.nilable(Date),
292
340
  discarded_at: T.nilable(Time),
293
341
  doing_business_as_names: T::Array[String],
294
342
  email: T.nilable(String),
343
+ expected_activity_volume: T.nilable(Integer),
295
344
  first_name: T.nilable(String),
296
345
  identifications:
297
346
  T::Array[ModernTreasury::LegalEntity::Identification],
298
347
  industry_classifications:
299
348
  T::Array[ModernTreasury::LegalEntityIndustryClassification],
349
+ intended_use: T.nilable(String),
300
350
  last_name: T.nilable(String),
301
- legal_entity_associations:
302
- T.nilable(T::Array[ModernTreasury::LegalEntityAssociation]),
303
351
  legal_entity_type:
304
352
  ModernTreasury::LegalEntity::LegalEntityType::TaggedSymbol,
305
353
  legal_structure:
@@ -310,17 +358,21 @@ module ModernTreasury
310
358
  metadata: T::Hash[Symbol, String],
311
359
  middle_name: T.nilable(String),
312
360
  object: String,
361
+ operating_jurisdictions: T::Array[String],
313
362
  phone_numbers: T::Array[ModernTreasury::LegalEntity::PhoneNumber],
314
363
  politically_exposed_person: T.nilable(T::Boolean),
315
364
  preferred_name: T.nilable(String),
316
365
  prefix: T.nilable(String),
366
+ primary_social_media_sites: T::Array[String],
317
367
  risk_rating:
318
368
  T.nilable(ModernTreasury::LegalEntity::RiskRating::TaggedSymbol),
319
369
  suffix: T.nilable(String),
320
370
  updated_at: Time,
321
371
  wealth_and_employment_details:
322
372
  T.nilable(ModernTreasury::LegalEntityWealthEmploymentDetail),
323
- website: T.nilable(String)
373
+ website: T.nilable(String),
374
+ legal_entity_associations:
375
+ T.nilable(T::Array[ModernTreasury::LegalEntityAssociation])
324
376
  }
325
377
  )
326
378
  end