modern_treasury 0.11.0 → 0.12.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 (116) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/README.md +10 -1
  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/expected_payment.rb +69 -1
  14. data/lib/modern_treasury/models/expected_payment_create_params.rb +65 -1
  15. data/lib/modern_treasury/models/expected_payment_update_params.rb +65 -1
  16. data/lib/modern_treasury/models/incoming_payment_detail.rb +5 -0
  17. data/lib/modern_treasury/models/incoming_payment_detail_create_async_params.rb +5 -0
  18. data/lib/modern_treasury/models/incoming_payment_detail_list_params.rb +5 -0
  19. data/lib/modern_treasury/models/internal_account.rb +10 -1
  20. data/lib/modern_treasury/models/internal_account_update_params.rb +9 -1
  21. data/lib/modern_treasury/models/invoice.rb +2 -0
  22. data/lib/modern_treasury/models/invoice_create_params.rb +1 -19
  23. data/lib/modern_treasury/models/invoice_update_params.rb +1 -19
  24. data/lib/modern_treasury/models/ledger_entry.rb +10 -1
  25. data/lib/modern_treasury/models/ledger_entry_create_request.rb +10 -1
  26. data/lib/modern_treasury/models/ledger_transactions/ledger_transaction_version.rb +10 -1
  27. data/lib/modern_treasury/models/legal_entity.rb +61 -11
  28. data/lib/modern_treasury/models/legal_entity_association.rb +3 -559
  29. data/lib/modern_treasury/models/legal_entity_association_inline_create.rb +60 -0
  30. data/lib/modern_treasury/models/legal_entity_create_params.rb +54 -59
  31. data/lib/modern_treasury/models/legal_entity_update_params.rb +51 -1
  32. data/lib/modern_treasury/models/payment_order.rb +4 -0
  33. data/lib/modern_treasury/models/payment_reference.rb +4 -0
  34. data/lib/modern_treasury/models/return_object.rb +5 -0
  35. data/lib/modern_treasury/models/transaction.rb +1 -0
  36. data/lib/modern_treasury/models.rb +4 -0
  37. data/lib/modern_treasury/resources/expected_payments.rb +18 -2
  38. data/lib/modern_treasury/resources/internal_accounts.rb +3 -1
  39. data/lib/modern_treasury/resources/invoices.rb +2 -10
  40. data/lib/modern_treasury/resources/ledger_accounts.rb +3 -3
  41. data/lib/modern_treasury/resources/ledger_transactions.rb +5 -2
  42. data/lib/modern_treasury/resources/legal_entities.rb +27 -3
  43. data/lib/modern_treasury/version.rb +1 -1
  44. data/lib/modern_treasury.rb +3 -0
  45. data/manifest.yaml +1 -0
  46. data/rbi/modern_treasury/models/bulk_request_create_params.rbi +272 -0
  47. data/rbi/modern_treasury/models/child_legal_entity.rbi +969 -0
  48. data/rbi/modern_treasury/models/child_legal_entity_create.rbi +78 -0
  49. data/rbi/modern_treasury/models/connection_legal_entity.rbi +10 -0
  50. data/rbi/modern_treasury/models/connection_legal_entity_create_params.rbi +61 -135
  51. data/rbi/modern_treasury/models/connection_legal_entity_list_params.rbi +10 -0
  52. data/rbi/modern_treasury/models/counterparty_create_params.rbi +61 -135
  53. data/rbi/modern_treasury/models/expected_payment.rbi +136 -0
  54. data/rbi/modern_treasury/models/expected_payment_create_params.rbi +136 -0
  55. data/rbi/modern_treasury/models/expected_payment_update_params.rbi +136 -0
  56. data/rbi/modern_treasury/models/incoming_payment_detail.rbi +25 -0
  57. data/rbi/modern_treasury/models/incoming_payment_detail_create_async_params.rbi +25 -0
  58. data/rbi/modern_treasury/models/incoming_payment_detail_list_params.rbi +25 -0
  59. data/rbi/modern_treasury/models/internal_account.rbi +10 -0
  60. data/rbi/modern_treasury/models/internal_account_update_params.rbi +11 -0
  61. data/rbi/modern_treasury/models/invoice_create_params.rbi +0 -20
  62. data/rbi/modern_treasury/models/invoice_update_params.rbi +0 -20
  63. data/rbi/modern_treasury/models/ledger_entry.rbi +10 -0
  64. data/rbi/modern_treasury/models/ledger_entry_create_request.rbi +13 -0
  65. data/rbi/modern_treasury/models/ledger_transactions/ledger_transaction_version.rbi +10 -0
  66. data/rbi/modern_treasury/models/legal_entity.rbi +67 -15
  67. data/rbi/modern_treasury/models/legal_entity_association.rbi +4 -962
  68. data/rbi/modern_treasury/models/legal_entity_association_inline_create.rbi +130 -0
  69. data/rbi/modern_treasury/models/legal_entity_create_params.rbi +61 -134
  70. data/rbi/modern_treasury/models/legal_entity_update_params.rbi +58 -0
  71. data/rbi/modern_treasury/models/payment_order.rbi +20 -0
  72. data/rbi/modern_treasury/models/payment_reference.rbi +20 -0
  73. data/rbi/modern_treasury/models/return_object.rbi +22 -0
  74. data/rbi/modern_treasury/models/transaction.rbi +5 -0
  75. data/rbi/modern_treasury/models.rbi +5 -0
  76. data/rbi/modern_treasury/resources/expected_payments.rbi +44 -0
  77. data/rbi/modern_treasury/resources/internal_accounts.rbi +3 -0
  78. data/rbi/modern_treasury/resources/invoices.rbi +0 -16
  79. data/rbi/modern_treasury/resources/ledger_accounts.rbi +3 -3
  80. data/rbi/modern_treasury/resources/ledger_transactions.rbi +3 -2
  81. data/rbi/modern_treasury/resources/legal_entities.rbi +41 -1
  82. data/sig/modern_treasury/models/bulk_request_create_params.rbs +84 -0
  83. data/sig/modern_treasury/models/child_legal_entity.rbs +469 -0
  84. data/sig/modern_treasury/models/child_legal_entity_create.rbs +39 -0
  85. data/sig/modern_treasury/models/connection_legal_entity.rbs +4 -1
  86. data/sig/modern_treasury/models/connection_legal_entity_create_params.rbs +38 -60
  87. data/sig/modern_treasury/models/connection_legal_entity_list_params.rbs +4 -1
  88. data/sig/modern_treasury/models/counterparty_create_params.rbs +38 -60
  89. data/sig/modern_treasury/models/expected_payment.rbs +42 -0
  90. data/sig/modern_treasury/models/expected_payment_create_params.rbs +42 -0
  91. data/sig/modern_treasury/models/expected_payment_update_params.rbs +42 -0
  92. data/sig/modern_treasury/models/incoming_payment_detail.rbs +10 -0
  93. data/sig/modern_treasury/models/incoming_payment_detail_create_async_params.rbs +10 -0
  94. data/sig/modern_treasury/models/incoming_payment_detail_list_params.rbs +10 -0
  95. data/sig/modern_treasury/models/internal_account.rbs +5 -0
  96. data/sig/modern_treasury/models/internal_account_update_params.rbs +7 -0
  97. data/sig/modern_treasury/models/invoice_create_params.rbs +0 -10
  98. data/sig/modern_treasury/models/invoice_update_params.rbs +0 -10
  99. data/sig/modern_treasury/models/ledger_entry.rbs +5 -0
  100. data/sig/modern_treasury/models/ledger_entry_create_request.rbs +7 -0
  101. data/sig/modern_treasury/models/ledger_transactions/ledger_transaction_version.rbs +5 -0
  102. data/sig/modern_treasury/models/legal_entity.rbs +38 -8
  103. data/sig/modern_treasury/models/legal_entity_association.rbs +4 -435
  104. data/sig/modern_treasury/models/legal_entity_association_inline_create.rbs +59 -0
  105. data/sig/modern_treasury/models/legal_entity_create_params.rbs +38 -60
  106. data/sig/modern_treasury/models/legal_entity_update_params.rbs +34 -0
  107. data/sig/modern_treasury/models/payment_order.rbs +8 -0
  108. data/sig/modern_treasury/models/payment_reference.rbs +8 -0
  109. data/sig/modern_treasury/models/return_object.rbs +10 -0
  110. data/sig/modern_treasury/models/transaction.rbs +2 -0
  111. data/sig/modern_treasury/models.rbs +4 -0
  112. data/sig/modern_treasury/resources/expected_payments.rbs +8 -0
  113. data/sig/modern_treasury/resources/internal_accounts.rbs +1 -0
  114. data/sig/modern_treasury/resources/invoices.rbs +0 -4
  115. data/sig/modern_treasury/resources/legal_entities.rbs +13 -1
  116. metadata +8 -2
@@ -19,6 +19,38 @@ module ModernTreasury
19
19
  sig { returns(T.nilable(Integer)) }
20
20
  attr_accessor :amount_lower_bound
21
21
 
22
+ # The amount reconciled for this expected payment. Value in specified currency's
23
+ # smallest unit. e.g. $10 would be represented as 1000.
24
+ sig { returns(T.nilable(Integer)) }
25
+ attr_accessor :amount_reconciled
26
+
27
+ # One of credit or debit. Indicates whether amount_reconciled is a credit or debit
28
+ # amount.
29
+ sig do
30
+ returns(
31
+ T.nilable(
32
+ ModernTreasury::ExpectedPaymentUpdateParams::AmountReconciledDirection::OrSymbol
33
+ )
34
+ )
35
+ end
36
+ attr_accessor :amount_reconciled_direction
37
+
38
+ # The amount that remains unreconciled for this expected payment. Value in
39
+ # specified currency's smallest unit. e.g. $10 would be represented as 1000.
40
+ sig { returns(T.nilable(Integer)) }
41
+ attr_accessor :amount_unreconciled
42
+
43
+ # One of credit or debit. Indicates whether amount_unreconciled is a credit or
44
+ # debit amount.
45
+ sig do
46
+ returns(
47
+ T.nilable(
48
+ ModernTreasury::ExpectedPaymentUpdateParams::AmountUnreconciledDirection::OrSymbol
49
+ )
50
+ )
51
+ end
52
+ attr_accessor :amount_unreconciled_direction
53
+
22
54
  # The highest amount this expected payment may be equal to. Value in specified
23
55
  # currency's smallest unit. e.g. $10 would be represented as 1000.
24
56
  sig { returns(T.nilable(Integer)) }
@@ -115,6 +147,16 @@ module ModernTreasury
115
147
  sig do
116
148
  params(
117
149
  amount_lower_bound: T.nilable(Integer),
150
+ amount_reconciled: T.nilable(Integer),
151
+ amount_reconciled_direction:
152
+ T.nilable(
153
+ ModernTreasury::ExpectedPaymentUpdateParams::AmountReconciledDirection::OrSymbol
154
+ ),
155
+ amount_unreconciled: T.nilable(Integer),
156
+ amount_unreconciled_direction:
157
+ T.nilable(
158
+ ModernTreasury::ExpectedPaymentUpdateParams::AmountUnreconciledDirection::OrSymbol
159
+ ),
118
160
  amount_upper_bound: T.nilable(Integer),
119
161
  counterparty_id: T.nilable(String),
120
162
  currency: T.nilable(ModernTreasury::Currency::OrSymbol),
@@ -146,6 +188,18 @@ module ModernTreasury
146
188
  # The lowest amount this expected payment may be equal to. Value in specified
147
189
  # currency's smallest unit. e.g. $10 would be represented as 1000.
148
190
  amount_lower_bound: nil,
191
+ # The amount reconciled for this expected payment. Value in specified currency's
192
+ # smallest unit. e.g. $10 would be represented as 1000.
193
+ amount_reconciled: nil,
194
+ # One of credit or debit. Indicates whether amount_reconciled is a credit or debit
195
+ # amount.
196
+ amount_reconciled_direction: nil,
197
+ # The amount that remains unreconciled for this expected payment. Value in
198
+ # specified currency's smallest unit. e.g. $10 would be represented as 1000.
199
+ amount_unreconciled: nil,
200
+ # One of credit or debit. Indicates whether amount_unreconciled is a credit or
201
+ # debit amount.
202
+ amount_unreconciled_direction: nil,
149
203
  # The highest amount this expected payment may be equal to. Value in specified
150
204
  # currency's smallest unit. e.g. $10 would be represented as 1000.
151
205
  amount_upper_bound: nil,
@@ -198,6 +252,16 @@ module ModernTreasury
198
252
  override.returns(
199
253
  {
200
254
  amount_lower_bound: T.nilable(Integer),
255
+ amount_reconciled: T.nilable(Integer),
256
+ amount_reconciled_direction:
257
+ T.nilable(
258
+ ModernTreasury::ExpectedPaymentUpdateParams::AmountReconciledDirection::OrSymbol
259
+ ),
260
+ amount_unreconciled: T.nilable(Integer),
261
+ amount_unreconciled_direction:
262
+ T.nilable(
263
+ ModernTreasury::ExpectedPaymentUpdateParams::AmountUnreconciledDirection::OrSymbol
264
+ ),
201
265
  amount_upper_bound: T.nilable(Integer),
202
266
  counterparty_id: T.nilable(String),
203
267
  currency: T.nilable(ModernTreasury::Currency::OrSymbol),
@@ -229,6 +293,78 @@ module ModernTreasury
229
293
  def to_hash
230
294
  end
231
295
 
296
+ # One of credit or debit. Indicates whether amount_reconciled is a credit or debit
297
+ # amount.
298
+ module AmountReconciledDirection
299
+ extend ModernTreasury::Internal::Type::Enum
300
+
301
+ TaggedSymbol =
302
+ T.type_alias do
303
+ T.all(
304
+ Symbol,
305
+ ModernTreasury::ExpectedPaymentUpdateParams::AmountReconciledDirection
306
+ )
307
+ end
308
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
309
+
310
+ CREDIT =
311
+ T.let(
312
+ :credit,
313
+ ModernTreasury::ExpectedPaymentUpdateParams::AmountReconciledDirection::TaggedSymbol
314
+ )
315
+ DEBIT =
316
+ T.let(
317
+ :debit,
318
+ ModernTreasury::ExpectedPaymentUpdateParams::AmountReconciledDirection::TaggedSymbol
319
+ )
320
+
321
+ sig do
322
+ override.returns(
323
+ T::Array[
324
+ ModernTreasury::ExpectedPaymentUpdateParams::AmountReconciledDirection::TaggedSymbol
325
+ ]
326
+ )
327
+ end
328
+ def self.values
329
+ end
330
+ end
331
+
332
+ # One of credit or debit. Indicates whether amount_unreconciled is a credit or
333
+ # debit amount.
334
+ module AmountUnreconciledDirection
335
+ extend ModernTreasury::Internal::Type::Enum
336
+
337
+ TaggedSymbol =
338
+ T.type_alias do
339
+ T.all(
340
+ Symbol,
341
+ ModernTreasury::ExpectedPaymentUpdateParams::AmountUnreconciledDirection
342
+ )
343
+ end
344
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
345
+
346
+ CREDIT =
347
+ T.let(
348
+ :credit,
349
+ ModernTreasury::ExpectedPaymentUpdateParams::AmountUnreconciledDirection::TaggedSymbol
350
+ )
351
+ DEBIT =
352
+ T.let(
353
+ :debit,
354
+ ModernTreasury::ExpectedPaymentUpdateParams::AmountUnreconciledDirection::TaggedSymbol
355
+ )
356
+
357
+ sig do
358
+ override.returns(
359
+ T::Array[
360
+ ModernTreasury::ExpectedPaymentUpdateParams::AmountUnreconciledDirection::TaggedSymbol
361
+ ]
362
+ )
363
+ end
364
+ def self.values
365
+ end
366
+ end
367
+
232
368
  # One of credit or debit. When you are receiving money, use credit. When you are
233
369
  # being charged, use debit.
234
370
  module Direction
@@ -618,6 +618,11 @@ module ModernTreasury
618
618
  :bacs,
619
619
  ModernTreasury::IncomingPaymentDetail::Type::TaggedSymbol
620
620
  )
621
+ BASE =
622
+ T.let(
623
+ :base,
624
+ ModernTreasury::IncomingPaymentDetail::Type::TaggedSymbol
625
+ )
621
626
  BOOK =
622
627
  T.let(
623
628
  :book,
@@ -630,6 +635,11 @@ module ModernTreasury
630
635
  )
631
636
  EFT =
632
637
  T.let(:eft, ModernTreasury::IncomingPaymentDetail::Type::TaggedSymbol)
638
+ ETHEREUM =
639
+ T.let(
640
+ :ethereum,
641
+ ModernTreasury::IncomingPaymentDetail::Type::TaggedSymbol
642
+ )
633
643
  INTERAC =
634
644
  T.let(
635
645
  :interac,
@@ -645,6 +655,11 @@ module ModernTreasury
645
655
  :nz_becs,
646
656
  ModernTreasury::IncomingPaymentDetail::Type::TaggedSymbol
647
657
  )
658
+ POLYGON =
659
+ T.let(
660
+ :polygon,
661
+ ModernTreasury::IncomingPaymentDetail::Type::TaggedSymbol
662
+ )
648
663
  RTP =
649
664
  T.let(:rtp, ModernTreasury::IncomingPaymentDetail::Type::TaggedSymbol)
650
665
  SEPA =
@@ -657,11 +672,21 @@ module ModernTreasury
657
672
  :signet,
658
673
  ModernTreasury::IncomingPaymentDetail::Type::TaggedSymbol
659
674
  )
675
+ SOLANA =
676
+ T.let(
677
+ :solana,
678
+ ModernTreasury::IncomingPaymentDetail::Type::TaggedSymbol
679
+ )
660
680
  WIRE =
661
681
  T.let(
662
682
  :wire,
663
683
  ModernTreasury::IncomingPaymentDetail::Type::TaggedSymbol
664
684
  )
685
+ ZENGIN =
686
+ T.let(
687
+ :zengin,
688
+ ModernTreasury::IncomingPaymentDetail::Type::TaggedSymbol
689
+ )
665
690
 
666
691
  sig do
667
692
  override.returns(
@@ -213,6 +213,11 @@ module ModernTreasury
213
213
  :bacs,
214
214
  ModernTreasury::IncomingPaymentDetailCreateAsyncParams::Type::TaggedSymbol
215
215
  )
216
+ BASE =
217
+ T.let(
218
+ :base,
219
+ ModernTreasury::IncomingPaymentDetailCreateAsyncParams::Type::TaggedSymbol
220
+ )
216
221
  BOOK =
217
222
  T.let(
218
223
  :book,
@@ -228,6 +233,11 @@ module ModernTreasury
228
233
  :eft,
229
234
  ModernTreasury::IncomingPaymentDetailCreateAsyncParams::Type::TaggedSymbol
230
235
  )
236
+ ETHEREUM =
237
+ T.let(
238
+ :ethereum,
239
+ ModernTreasury::IncomingPaymentDetailCreateAsyncParams::Type::TaggedSymbol
240
+ )
231
241
  INTERAC =
232
242
  T.let(
233
243
  :interac,
@@ -243,6 +253,11 @@ module ModernTreasury
243
253
  :nz_becs,
244
254
  ModernTreasury::IncomingPaymentDetailCreateAsyncParams::Type::TaggedSymbol
245
255
  )
256
+ POLYGON =
257
+ T.let(
258
+ :polygon,
259
+ ModernTreasury::IncomingPaymentDetailCreateAsyncParams::Type::TaggedSymbol
260
+ )
246
261
  RTP =
247
262
  T.let(
248
263
  :rtp,
@@ -258,11 +273,21 @@ module ModernTreasury
258
273
  :signet,
259
274
  ModernTreasury::IncomingPaymentDetailCreateAsyncParams::Type::TaggedSymbol
260
275
  )
276
+ SOLANA =
277
+ T.let(
278
+ :solana,
279
+ ModernTreasury::IncomingPaymentDetailCreateAsyncParams::Type::TaggedSymbol
280
+ )
261
281
  WIRE =
262
282
  T.let(
263
283
  :wire,
264
284
  ModernTreasury::IncomingPaymentDetailCreateAsyncParams::Type::TaggedSymbol
265
285
  )
286
+ ZENGIN =
287
+ T.let(
288
+ :zengin,
289
+ ModernTreasury::IncomingPaymentDetailCreateAsyncParams::Type::TaggedSymbol
290
+ )
266
291
 
267
292
  sig do
268
293
  override.returns(
@@ -233,6 +233,11 @@ module ModernTreasury
233
233
  :bacs,
234
234
  ModernTreasury::IncomingPaymentDetailListParams::Type::TaggedSymbol
235
235
  )
236
+ BASE =
237
+ T.let(
238
+ :base,
239
+ ModernTreasury::IncomingPaymentDetailListParams::Type::TaggedSymbol
240
+ )
236
241
  BOOK =
237
242
  T.let(
238
243
  :book,
@@ -248,6 +253,11 @@ module ModernTreasury
248
253
  :eft,
249
254
  ModernTreasury::IncomingPaymentDetailListParams::Type::TaggedSymbol
250
255
  )
256
+ ETHEREUM =
257
+ T.let(
258
+ :ethereum,
259
+ ModernTreasury::IncomingPaymentDetailListParams::Type::TaggedSymbol
260
+ )
251
261
  INTERAC =
252
262
  T.let(
253
263
  :interac,
@@ -263,6 +273,11 @@ module ModernTreasury
263
273
  :nz_becs,
264
274
  ModernTreasury::IncomingPaymentDetailListParams::Type::TaggedSymbol
265
275
  )
276
+ POLYGON =
277
+ T.let(
278
+ :polygon,
279
+ ModernTreasury::IncomingPaymentDetailListParams::Type::TaggedSymbol
280
+ )
266
281
  RTP =
267
282
  T.let(
268
283
  :rtp,
@@ -278,11 +293,21 @@ module ModernTreasury
278
293
  :signet,
279
294
  ModernTreasury::IncomingPaymentDetailListParams::Type::TaggedSymbol
280
295
  )
296
+ SOLANA =
297
+ T.let(
298
+ :solana,
299
+ ModernTreasury::IncomingPaymentDetailListParams::Type::TaggedSymbol
300
+ )
281
301
  WIRE =
282
302
  T.let(
283
303
  :wire,
284
304
  ModernTreasury::IncomingPaymentDetailListParams::Type::TaggedSymbol
285
305
  )
306
+ ZENGIN =
307
+ T.let(
308
+ :zengin,
309
+ ModernTreasury::IncomingPaymentDetailListParams::Type::TaggedSymbol
310
+ )
286
311
 
287
312
  sig do
288
313
  override.returns(
@@ -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,