modern_treasury 0.5.0 → 0.7.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 (89) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +49 -0
  3. data/README.md +9 -9
  4. data/lib/modern_treasury/errors.rb +25 -11
  5. data/lib/modern_treasury/file_part.rb +10 -7
  6. data/lib/modern_treasury/internal/page.rb +3 -3
  7. data/lib/modern_treasury/internal/transport/base_client.rb +11 -7
  8. data/lib/modern_treasury/internal/transport/pooled_net_requester.rb +7 -10
  9. data/lib/modern_treasury/internal/type/base_page.rb +1 -1
  10. data/lib/modern_treasury/internal/type/file_input.rb +7 -4
  11. data/lib/modern_treasury/internal/util.rb +5 -5
  12. data/lib/modern_treasury/models/bulk_request_create_params.rb +155 -2
  13. data/lib/modern_treasury/models/counterparty.rb +5 -18
  14. data/lib/modern_treasury/models/counterparty_create_params.rb +7 -16
  15. data/lib/modern_treasury/models/incoming_payment_detail.rb +23 -1
  16. data/lib/modern_treasury/models/internal_account.rb +25 -1
  17. data/lib/modern_treasury/models/internal_account_list_params.rb +23 -1
  18. data/lib/modern_treasury/models/invoice_list_params.rb +17 -1
  19. data/lib/modern_treasury/models/line_item.rb +55 -1
  20. data/lib/modern_treasury/models/payment_order.rb +226 -1
  21. data/lib/modern_treasury/models/payment_order_create_async_params.rb +72 -1
  22. data/lib/modern_treasury/models/payment_order_create_params.rb +71 -1
  23. data/lib/modern_treasury/models/payment_order_list_params.rb +1 -0
  24. data/lib/modern_treasury/models/payment_order_update_params.rb +72 -1
  25. data/lib/modern_treasury/models/payment_orders/reversal.rb +24 -1
  26. data/lib/modern_treasury/models/payment_reference.rb +1 -0
  27. data/lib/modern_treasury/models/return_create_params.rb +21 -1
  28. data/lib/modern_treasury/models/return_object.rb +25 -1
  29. data/lib/modern_treasury/models/transaction.rb +1 -0
  30. data/lib/modern_treasury/resources/counterparties.rb +1 -1
  31. data/lib/modern_treasury/resources/internal_accounts.rb +3 -1
  32. data/lib/modern_treasury/resources/invoices.rb +5 -1
  33. data/lib/modern_treasury/resources/payment_orders.rb +21 -3
  34. data/lib/modern_treasury/resources/returns.rb +3 -1
  35. data/lib/modern_treasury/version.rb +1 -1
  36. data/rbi/modern_treasury/errors.rbi +29 -2
  37. data/rbi/modern_treasury/file_part.rbi +1 -1
  38. data/rbi/modern_treasury/internal/transport/base_client.rbi +4 -5
  39. data/rbi/modern_treasury/internal/type/base_page.rbi +1 -1
  40. data/rbi/modern_treasury/internal/util.rbi +1 -1
  41. data/rbi/modern_treasury/models/bulk_request_create_params.rbi +289 -0
  42. data/rbi/modern_treasury/models/counterparty.rbi +3 -49
  43. data/rbi/modern_treasury/models/counterparty_create_params.rbi +4 -62
  44. data/rbi/modern_treasury/models/incoming_payment_detail.rbi +54 -0
  45. data/rbi/modern_treasury/models/internal_account.rbi +52 -0
  46. data/rbi/modern_treasury/models/internal_account_list_params.rbi +66 -0
  47. data/rbi/modern_treasury/models/invoice_list_params.rbi +22 -0
  48. data/rbi/modern_treasury/models/line_item.rbi +69 -0
  49. data/rbi/modern_treasury/models/payment_order.rbi +374 -0
  50. data/rbi/modern_treasury/models/payment_order_create_async_params.rbi +140 -0
  51. data/rbi/modern_treasury/models/payment_order_create_params.rbi +137 -0
  52. data/rbi/modern_treasury/models/payment_order_list_params.rbi +5 -0
  53. data/rbi/modern_treasury/models/payment_order_update_params.rbi +142 -0
  54. data/rbi/modern_treasury/models/payment_orders/reversal.rbi +54 -0
  55. data/rbi/modern_treasury/models/payment_reference.rbi +5 -0
  56. data/rbi/modern_treasury/models/return_create_params.rbi +64 -0
  57. data/rbi/modern_treasury/models/return_object.rbi +58 -0
  58. data/rbi/modern_treasury/models/transaction.rbi +5 -0
  59. data/rbi/modern_treasury/resources/counterparties.rbi +1 -2
  60. data/rbi/modern_treasury/resources/internal_accounts.rbi +3 -0
  61. data/rbi/modern_treasury/resources/invoices.rbi +6 -0
  62. data/rbi/modern_treasury/resources/payment_orders.rbi +33 -0
  63. data/rbi/modern_treasury/resources/returns.rbi +4 -0
  64. data/sig/modern_treasury/errors.rbs +7 -0
  65. data/sig/modern_treasury/file_part.rbs +1 -1
  66. data/sig/modern_treasury/models/bulk_request_create_params.rbs +98 -0
  67. data/sig/modern_treasury/models/counterparty.rbs +4 -18
  68. data/sig/modern_treasury/models/counterparty_create_params.rbs +5 -21
  69. data/sig/modern_treasury/models/incoming_payment_detail.rbs +18 -0
  70. data/sig/modern_treasury/models/internal_account.rbs +20 -0
  71. data/sig/modern_treasury/models/internal_account_list_params.rbs +25 -1
  72. data/sig/modern_treasury/models/invoice_list_params.rbs +14 -0
  73. data/sig/modern_treasury/models/line_item.rbs +22 -0
  74. data/sig/modern_treasury/models/payment_order.rbs +154 -0
  75. data/sig/modern_treasury/models/payment_order_create_async_params.rbs +48 -0
  76. data/sig/modern_treasury/models/payment_order_create_params.rbs +48 -0
  77. data/sig/modern_treasury/models/payment_order_list_params.rbs +2 -0
  78. data/sig/modern_treasury/models/payment_order_update_params.rbs +50 -0
  79. data/sig/modern_treasury/models/payment_orders/reversal.rbs +18 -0
  80. data/sig/modern_treasury/models/payment_reference.rbs +2 -0
  81. data/sig/modern_treasury/models/return_create_params.rbs +23 -1
  82. data/sig/modern_treasury/models/return_object.rbs +22 -0
  83. data/sig/modern_treasury/models/transaction.rbs +2 -0
  84. data/sig/modern_treasury/resources/counterparties.rbs +1 -1
  85. data/sig/modern_treasury/resources/internal_accounts.rbs +1 -0
  86. data/sig/modern_treasury/resources/invoices.rbs +2 -0
  87. data/sig/modern_treasury/resources/payment_orders.rbs +9 -0
  88. data/sig/modern_treasury/resources/returns.rbs +1 -0
  89. metadata +2 -2
@@ -11,11 +11,26 @@ module ModernTreasury
11
11
  sig { returns(String) }
12
12
  attr_accessor :id
13
13
 
14
+ sig { returns(ModernTreasury::PaymentOrder::Accounting) }
15
+ attr_reader :accounting
16
+
17
+ sig do
18
+ params(
19
+ accounting: ModernTreasury::PaymentOrder::Accounting::OrHash
20
+ ).void
21
+ end
22
+ attr_writer :accounting
23
+
14
24
  # The ID of one of your accounting categories. Note that these will only be
15
25
  # accessible if your accounting system has been connected.
16
26
  sig { returns(T.nilable(String)) }
17
27
  attr_accessor :accounting_category_id
18
28
 
29
+ # The ID of one of your accounting ledger classes. Note that these will only be
30
+ # accessible if your accounting system has been connected.
31
+ sig { returns(T.nilable(String)) }
32
+ attr_accessor :accounting_ledger_class_id
33
+
19
34
  # Value in specified currency's smallest unit. e.g. $10 would be represented as
20
35
  # 1000 (cents). For RTP, the maximum amount allowed by the network is $100,000.
21
36
  sig { returns(Integer) }
@@ -43,6 +58,19 @@ module ModernTreasury
43
58
  sig { returns(ModernTreasury::Currency::TaggedSymbol) }
44
59
  attr_accessor :currency
45
60
 
61
+ # If the payment order's status is `held`, this will include the hold object's
62
+ # data.
63
+ sig { returns(T.nilable(ModernTreasury::PaymentOrder::CurrentHold)) }
64
+ attr_reader :current_hold
65
+
66
+ sig do
67
+ params(
68
+ current_hold:
69
+ T.nilable(ModernTreasury::PaymentOrder::CurrentHold::OrHash)
70
+ ).void
71
+ end
72
+ attr_writer :current_hold
73
+
46
74
  # If the payment order's status is `returned`, this will include the return
47
75
  # object's data.
48
76
  sig { returns(T.nilable(ModernTreasury::ReturnObject)) }
@@ -173,6 +201,14 @@ module ModernTreasury
173
201
  end
174
202
  attr_accessor :receiving_account_type
175
203
 
204
+ # One of `unreconciled`, `tentatively_reconciled` or `reconciled`.
205
+ sig do
206
+ returns(
207
+ ModernTreasury::PaymentOrder::ReconciliationStatus::TaggedSymbol
208
+ )
209
+ end
210
+ attr_accessor :reconciliation_status
211
+
176
212
  sig { returns(T::Array[ModernTreasury::PaymentOrder::ReferenceNumber]) }
177
213
  attr_accessor :reference_numbers
178
214
 
@@ -277,13 +313,17 @@ module ModernTreasury
277
313
  sig do
278
314
  params(
279
315
  id: String,
316
+ accounting: ModernTreasury::PaymentOrder::Accounting::OrHash,
280
317
  accounting_category_id: T.nilable(String),
318
+ accounting_ledger_class_id: T.nilable(String),
281
319
  amount: Integer,
282
320
  charge_bearer:
283
321
  T.nilable(ModernTreasury::PaymentOrder::ChargeBearer::OrSymbol),
284
322
  counterparty_id: T.nilable(String),
285
323
  created_at: Time,
286
324
  currency: ModernTreasury::Currency::OrSymbol,
325
+ current_hold:
326
+ T.nilable(ModernTreasury::PaymentOrder::CurrentHold::OrHash),
287
327
  current_return: T.nilable(ModernTreasury::ReturnObject::OrHash),
288
328
  description: T.nilable(String),
289
329
  direction: ModernTreasury::PaymentOrder::Direction::OrSymbol,
@@ -310,6 +350,8 @@ module ModernTreasury
310
350
  receiving_account_id: String,
311
351
  receiving_account_type:
312
352
  ModernTreasury::PaymentOrder::ReceivingAccountType::OrSymbol,
353
+ reconciliation_status:
354
+ ModernTreasury::PaymentOrder::ReconciliationStatus::OrSymbol,
313
355
  reference_numbers:
314
356
  T::Array[ModernTreasury::PaymentOrder::ReferenceNumber::OrHash],
315
357
  remittance_information: T.nilable(String),
@@ -342,9 +384,13 @@ module ModernTreasury
342
384
  end
343
385
  def self.new(
344
386
  id:,
387
+ accounting:,
345
388
  # The ID of one of your accounting categories. Note that these will only be
346
389
  # accessible if your accounting system has been connected.
347
390
  accounting_category_id:,
391
+ # The ID of one of your accounting ledger classes. Note that these will only be
392
+ # accessible if your accounting system has been connected.
393
+ accounting_ledger_class_id:,
348
394
  # Value in specified currency's smallest unit. e.g. $10 would be represented as
349
395
  # 1000 (cents). For RTP, the maximum amount allowed by the network is $100,000.
350
396
  amount:,
@@ -358,6 +404,9 @@ module ModernTreasury
358
404
  created_at:,
359
405
  # Defaults to the currency of the originating account.
360
406
  currency:,
407
+ # If the payment order's status is `held`, this will include the hold object's
408
+ # data.
409
+ current_hold:,
361
410
  # If the payment order's status is `returned`, this will include the return
362
411
  # object's data.
363
412
  current_return:,
@@ -421,6 +470,8 @@ module ModernTreasury
421
470
  # The receiving account ID. Can be an `external_account` or `internal_account`.
422
471
  receiving_account_id:,
423
472
  receiving_account_type:,
473
+ # One of `unreconciled`, `tentatively_reconciled` or `reconciled`.
474
+ reconciliation_status:,
424
475
  reference_numbers:,
425
476
  # For `ach`, this field will be passed through on an addenda record. For `wire`
426
477
  # payments the field will be passed through as the "Originator to Beneficiary
@@ -479,7 +530,9 @@ module ModernTreasury
479
530
  override.returns(
480
531
  {
481
532
  id: String,
533
+ accounting: ModernTreasury::PaymentOrder::Accounting,
482
534
  accounting_category_id: T.nilable(String),
535
+ accounting_ledger_class_id: T.nilable(String),
483
536
  amount: Integer,
484
537
  charge_bearer:
485
538
  T.nilable(
@@ -488,6 +541,7 @@ module ModernTreasury
488
541
  counterparty_id: T.nilable(String),
489
542
  created_at: Time,
490
543
  currency: ModernTreasury::Currency::TaggedSymbol,
544
+ current_hold: T.nilable(ModernTreasury::PaymentOrder::CurrentHold),
491
545
  current_return: T.nilable(ModernTreasury::ReturnObject),
492
546
  description: T.nilable(String),
493
547
  direction: ModernTreasury::PaymentOrder::Direction::TaggedSymbol,
@@ -514,6 +568,8 @@ module ModernTreasury
514
568
  receiving_account_id: String,
515
569
  receiving_account_type:
516
570
  ModernTreasury::PaymentOrder::ReceivingAccountType::TaggedSymbol,
571
+ reconciliation_status:
572
+ ModernTreasury::PaymentOrder::ReconciliationStatus::TaggedSymbol,
517
573
  reference_numbers:
518
574
  T::Array[ModernTreasury::PaymentOrder::ReferenceNumber],
519
575
  remittance_information: T.nilable(String),
@@ -546,6 +602,52 @@ module ModernTreasury
546
602
  def to_hash
547
603
  end
548
604
 
605
+ class Accounting < ModernTreasury::Internal::Type::BaseModel
606
+ OrHash =
607
+ T.type_alias do
608
+ T.any(
609
+ ModernTreasury::PaymentOrder::Accounting,
610
+ ModernTreasury::Internal::AnyHash
611
+ )
612
+ end
613
+
614
+ # The ID of one of your accounting categories. Note that these will only be
615
+ # accessible if your accounting system has been connected.
616
+ sig { returns(T.nilable(String)) }
617
+ attr_accessor :account_id
618
+
619
+ # The ID of one of the class objects in your accounting system. Class objects
620
+ # track segments of your business independent of client or project. Note that
621
+ # these will only be accessible if your accounting system has been connected.
622
+ sig { returns(T.nilable(String)) }
623
+ attr_accessor :class_id
624
+
625
+ sig do
626
+ params(
627
+ account_id: T.nilable(String),
628
+ class_id: T.nilable(String)
629
+ ).returns(T.attached_class)
630
+ end
631
+ def self.new(
632
+ # The ID of one of your accounting categories. Note that these will only be
633
+ # accessible if your accounting system has been connected.
634
+ account_id: nil,
635
+ # The ID of one of the class objects in your accounting system. Class objects
636
+ # track segments of your business independent of client or project. Note that
637
+ # these will only be accessible if your accounting system has been connected.
638
+ class_id: nil
639
+ )
640
+ end
641
+
642
+ sig do
643
+ override.returns(
644
+ { account_id: T.nilable(String), class_id: T.nilable(String) }
645
+ )
646
+ end
647
+ def to_hash
648
+ end
649
+ end
650
+
549
651
  # The party that will pay the fees for the payment order. See
550
652
  # https://docs.moderntreasury.com/payments/docs/charge-bearer to understand the
551
653
  # differences between the options.
@@ -583,6 +685,235 @@ module ModernTreasury
583
685
  end
584
686
  end
585
687
 
688
+ class CurrentHold < ModernTreasury::Internal::Type::BaseModel
689
+ OrHash =
690
+ T.type_alias do
691
+ T.any(
692
+ ModernTreasury::PaymentOrder::CurrentHold,
693
+ ModernTreasury::Internal::AnyHash
694
+ )
695
+ end
696
+
697
+ sig { returns(String) }
698
+ attr_accessor :id
699
+
700
+ sig { returns(Time) }
701
+ attr_accessor :created_at
702
+
703
+ # The type of object
704
+ sig do
705
+ returns(
706
+ ModernTreasury::PaymentOrder::CurrentHold::Object::TaggedSymbol
707
+ )
708
+ end
709
+ attr_accessor :object
710
+
711
+ # The status of the hold
712
+ sig do
713
+ returns(
714
+ ModernTreasury::PaymentOrder::CurrentHold::Status::TaggedSymbol
715
+ )
716
+ end
717
+ attr_accessor :status
718
+
719
+ # The ID of the target being held
720
+ sig { returns(String) }
721
+ attr_accessor :target_id
722
+
723
+ # The type of target being held
724
+ sig do
725
+ returns(
726
+ ModernTreasury::PaymentOrder::CurrentHold::TargetType::TaggedSymbol
727
+ )
728
+ end
729
+ attr_accessor :target_type
730
+
731
+ sig { returns(Time) }
732
+ attr_accessor :updated_at
733
+
734
+ # This field will be true if this object exists in the live environment or false
735
+ # if it exists in the test environment.
736
+ sig { returns(T.nilable(T::Boolean)) }
737
+ attr_reader :live_mode
738
+
739
+ sig { params(live_mode: T::Boolean).void }
740
+ attr_writer :live_mode
741
+
742
+ # Additional metadata for the hold
743
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
744
+ attr_accessor :metadata
745
+
746
+ # The reason for the hold
747
+ sig { returns(T.nilable(String)) }
748
+ attr_accessor :reason
749
+
750
+ # The resolution of the hold
751
+ sig { returns(T.nilable(String)) }
752
+ attr_accessor :resolution
753
+
754
+ # When the hold was resolved
755
+ sig { returns(T.nilable(Time)) }
756
+ attr_accessor :resolved_at
757
+
758
+ # If the payment order's status is `held`, this will include the hold object's
759
+ # data.
760
+ sig do
761
+ params(
762
+ id: String,
763
+ created_at: Time,
764
+ object: ModernTreasury::PaymentOrder::CurrentHold::Object::OrSymbol,
765
+ status: ModernTreasury::PaymentOrder::CurrentHold::Status::OrSymbol,
766
+ target_id: String,
767
+ target_type:
768
+ ModernTreasury::PaymentOrder::CurrentHold::TargetType::OrSymbol,
769
+ updated_at: Time,
770
+ live_mode: T::Boolean,
771
+ metadata: T.nilable(T::Hash[Symbol, String]),
772
+ reason: T.nilable(String),
773
+ resolution: T.nilable(String),
774
+ resolved_at: T.nilable(Time)
775
+ ).returns(T.attached_class)
776
+ end
777
+ def self.new(
778
+ id:,
779
+ created_at:,
780
+ # The type of object
781
+ object:,
782
+ # The status of the hold
783
+ status:,
784
+ # The ID of the target being held
785
+ target_id:,
786
+ # The type of target being held
787
+ target_type:,
788
+ updated_at:,
789
+ # This field will be true if this object exists in the live environment or false
790
+ # if it exists in the test environment.
791
+ live_mode: nil,
792
+ # Additional metadata for the hold
793
+ metadata: nil,
794
+ # The reason for the hold
795
+ reason: nil,
796
+ # The resolution of the hold
797
+ resolution: nil,
798
+ # When the hold was resolved
799
+ resolved_at: nil
800
+ )
801
+ end
802
+
803
+ sig do
804
+ override.returns(
805
+ {
806
+ id: String,
807
+ created_at: Time,
808
+ object:
809
+ ModernTreasury::PaymentOrder::CurrentHold::Object::TaggedSymbol,
810
+ status:
811
+ ModernTreasury::PaymentOrder::CurrentHold::Status::TaggedSymbol,
812
+ target_id: String,
813
+ target_type:
814
+ ModernTreasury::PaymentOrder::CurrentHold::TargetType::TaggedSymbol,
815
+ updated_at: Time,
816
+ live_mode: T::Boolean,
817
+ metadata: T.nilable(T::Hash[Symbol, String]),
818
+ reason: T.nilable(String),
819
+ resolution: T.nilable(String),
820
+ resolved_at: T.nilable(Time)
821
+ }
822
+ )
823
+ end
824
+ def to_hash
825
+ end
826
+
827
+ # The type of object
828
+ module Object
829
+ extend ModernTreasury::Internal::Type::Enum
830
+
831
+ TaggedSymbol =
832
+ T.type_alias do
833
+ T.all(Symbol, ModernTreasury::PaymentOrder::CurrentHold::Object)
834
+ end
835
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
836
+
837
+ HOLD =
838
+ T.let(
839
+ :hold,
840
+ ModernTreasury::PaymentOrder::CurrentHold::Object::TaggedSymbol
841
+ )
842
+
843
+ sig do
844
+ override.returns(
845
+ T::Array[
846
+ ModernTreasury::PaymentOrder::CurrentHold::Object::TaggedSymbol
847
+ ]
848
+ )
849
+ end
850
+ def self.values
851
+ end
852
+ end
853
+
854
+ # The status of the hold
855
+ module Status
856
+ extend ModernTreasury::Internal::Type::Enum
857
+
858
+ TaggedSymbol =
859
+ T.type_alias do
860
+ T.all(Symbol, ModernTreasury::PaymentOrder::CurrentHold::Status)
861
+ end
862
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
863
+
864
+ ACTIVE =
865
+ T.let(
866
+ :active,
867
+ ModernTreasury::PaymentOrder::CurrentHold::Status::TaggedSymbol
868
+ )
869
+ RESOLVED =
870
+ T.let(
871
+ :resolved,
872
+ ModernTreasury::PaymentOrder::CurrentHold::Status::TaggedSymbol
873
+ )
874
+
875
+ sig do
876
+ override.returns(
877
+ T::Array[
878
+ ModernTreasury::PaymentOrder::CurrentHold::Status::TaggedSymbol
879
+ ]
880
+ )
881
+ end
882
+ def self.values
883
+ end
884
+ end
885
+
886
+ # The type of target being held
887
+ module TargetType
888
+ extend ModernTreasury::Internal::Type::Enum
889
+
890
+ TaggedSymbol =
891
+ T.type_alias do
892
+ T.all(
893
+ Symbol,
894
+ ModernTreasury::PaymentOrder::CurrentHold::TargetType
895
+ )
896
+ end
897
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
898
+
899
+ PAYMENT_ORDER =
900
+ T.let(
901
+ :payment_order,
902
+ ModernTreasury::PaymentOrder::CurrentHold::TargetType::TaggedSymbol
903
+ )
904
+
905
+ sig do
906
+ override.returns(
907
+ T::Array[
908
+ ModernTreasury::PaymentOrder::CurrentHold::TargetType::TaggedSymbol
909
+ ]
910
+ )
911
+ end
912
+ def self.values
913
+ end
914
+ end
915
+ end
916
+
586
917
  # One of `credit`, `debit`. Describes the direction money is flowing in the
587
918
  # transaction. A `credit` moves money from your account to someone else's. A
588
919
  # `debit` pulls money from someone else's account to your own. Note that wire,
@@ -702,6 +1033,43 @@ module ModernTreasury
702
1033
  end
703
1034
  end
704
1035
 
1036
+ # One of `unreconciled`, `tentatively_reconciled` or `reconciled`.
1037
+ module ReconciliationStatus
1038
+ extend ModernTreasury::Internal::Type::Enum
1039
+
1040
+ TaggedSymbol =
1041
+ T.type_alias do
1042
+ T.all(Symbol, ModernTreasury::PaymentOrder::ReconciliationStatus)
1043
+ end
1044
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1045
+
1046
+ UNRECONCILED =
1047
+ T.let(
1048
+ :unreconciled,
1049
+ ModernTreasury::PaymentOrder::ReconciliationStatus::TaggedSymbol
1050
+ )
1051
+ TENTATIVELY_RECONCILED =
1052
+ T.let(
1053
+ :tentatively_reconciled,
1054
+ ModernTreasury::PaymentOrder::ReconciliationStatus::TaggedSymbol
1055
+ )
1056
+ RECONCILED =
1057
+ T.let(
1058
+ :reconciled,
1059
+ ModernTreasury::PaymentOrder::ReconciliationStatus::TaggedSymbol
1060
+ )
1061
+
1062
+ sig do
1063
+ override.returns(
1064
+ T::Array[
1065
+ ModernTreasury::PaymentOrder::ReconciliationStatus::TaggedSymbol
1066
+ ]
1067
+ )
1068
+ end
1069
+ def self.values
1070
+ end
1071
+ end
1072
+
705
1073
  class ReferenceNumber < ModernTreasury::Internal::Type::BaseModel
706
1074
  OrHash =
707
1075
  T.type_alias do
@@ -1077,6 +1445,11 @@ module ModernTreasury
1077
1445
  :lob_check_id,
1078
1446
  ModernTreasury::PaymentOrder::ReferenceNumber::ReferenceNumberType::TaggedSymbol
1079
1447
  )
1448
+ MT_FOF_TRANSFER_ID =
1449
+ T.let(
1450
+ :mt_fof_transfer_id,
1451
+ ModernTreasury::PaymentOrder::ReferenceNumber::ReferenceNumberType::TaggedSymbol
1452
+ )
1080
1453
  OTHER =
1081
1454
  T.let(
1082
1455
  :other,
@@ -1268,6 +1641,7 @@ module ModernTreasury
1268
1641
  T.let(:denied, ModernTreasury::PaymentOrder::Status::TaggedSymbol)
1269
1642
  FAILED =
1270
1643
  T.let(:failed, ModernTreasury::PaymentOrder::Status::TaggedSymbol)
1644
+ HELD = T.let(:held, ModernTreasury::PaymentOrder::Status::TaggedSymbol)
1271
1645
  NEEDS_APPROVAL =
1272
1646
  T.let(
1273
1647
  :needs_approval,
@@ -40,11 +40,31 @@ module ModernTreasury
40
40
  sig { returns(ModernTreasury::PaymentOrderType::OrSymbol) }
41
41
  attr_accessor :type
42
42
 
43
+ sig do
44
+ returns(
45
+ T.nilable(ModernTreasury::PaymentOrderCreateAsyncParams::Accounting)
46
+ )
47
+ end
48
+ attr_reader :accounting
49
+
50
+ sig do
51
+ params(
52
+ accounting:
53
+ ModernTreasury::PaymentOrderCreateAsyncParams::Accounting::OrHash
54
+ ).void
55
+ end
56
+ attr_writer :accounting
57
+
43
58
  # The ID of one of your accounting categories. Note that these will only be
44
59
  # accessible if your accounting system has been connected.
45
60
  sig { returns(T.nilable(String)) }
46
61
  attr_accessor :accounting_category_id
47
62
 
63
+ # The ID of one of your accounting ledger classes. Note that these will only be
64
+ # accessible if your accounting system has been connected.
65
+ sig { returns(T.nilable(String)) }
66
+ attr_accessor :accounting_ledger_class_id
67
+
48
68
  # The party that will pay the fees for the payment order. See
49
69
  # https://docs.moderntreasury.com/payments/docs/charge-bearer to understand the
50
70
  # differences between the options.
@@ -249,6 +269,24 @@ module ModernTreasury
249
269
  sig { params(receiving_account_id: String).void }
250
270
  attr_writer :receiving_account_id
251
271
 
272
+ # One of `unreconciled`, `tentatively_reconciled` or `reconciled`.
273
+ sig do
274
+ returns(
275
+ T.nilable(
276
+ ModernTreasury::PaymentOrderCreateAsyncParams::ReconciliationStatus::OrSymbol
277
+ )
278
+ )
279
+ end
280
+ attr_reader :reconciliation_status
281
+
282
+ sig do
283
+ params(
284
+ reconciliation_status:
285
+ ModernTreasury::PaymentOrderCreateAsyncParams::ReconciliationStatus::OrSymbol
286
+ ).void
287
+ end
288
+ attr_writer :reconciliation_status
289
+
252
290
  # For `ach`, this field will be passed through on an addenda record. For `wire`
253
291
  # payments the field will be passed through as the "Originator to Beneficiary
254
292
  # Information", also known as OBI or Fedwire tag 6000.
@@ -307,7 +345,10 @@ module ModernTreasury
307
345
  ModernTreasury::PaymentOrderCreateAsyncParams::Direction::OrSymbol,
308
346
  originating_account_id: String,
309
347
  type: ModernTreasury::PaymentOrderType::OrSymbol,
348
+ accounting:
349
+ ModernTreasury::PaymentOrderCreateAsyncParams::Accounting::OrHash,
310
350
  accounting_category_id: T.nilable(String),
351
+ accounting_ledger_class_id: T.nilable(String),
311
352
  charge_bearer:
312
353
  T.nilable(
313
354
  ModernTreasury::PaymentOrderCreateAsyncParams::ChargeBearer::OrSymbol
@@ -340,6 +381,8 @@ module ModernTreasury
340
381
  receiving_account:
341
382
  ModernTreasury::PaymentOrderCreateAsyncParams::ReceivingAccount::OrHash,
342
383
  receiving_account_id: String,
384
+ reconciliation_status:
385
+ ModernTreasury::PaymentOrderCreateAsyncParams::ReconciliationStatus::OrSymbol,
343
386
  remittance_information: T.nilable(String),
344
387
  send_remittance_advice: T.nilable(T::Boolean),
345
388
  statement_descriptor: T.nilable(String),
@@ -367,9 +410,13 @@ module ModernTreasury
367
410
  # `sepa`, `bacs`, `au_becs`, `interac`, `neft`, `nics`,
368
411
  # `nz_national_clearing_code`, `sic`, `signet`, `provexchange`, `zengin`.
369
412
  type:,
413
+ accounting: nil,
370
414
  # The ID of one of your accounting categories. Note that these will only be
371
415
  # accessible if your accounting system has been connected.
372
416
  accounting_category_id: nil,
417
+ # The ID of one of your accounting ledger classes. Note that these will only be
418
+ # accessible if your accounting system has been connected.
419
+ accounting_ledger_class_id: nil,
373
420
  # The party that will pay the fees for the payment order. See
374
421
  # https://docs.moderntreasury.com/payments/docs/charge-bearer to understand the
375
422
  # differences between the options.
@@ -440,6 +487,8 @@ module ModernTreasury
440
487
  # `receiving_account_id`, you may pass the id of an external account or an
441
488
  # internal account.
442
489
  receiving_account_id: nil,
490
+ # One of `unreconciled`, `tentatively_reconciled` or `reconciled`.
491
+ reconciliation_status: nil,
443
492
  # For `ach`, this field will be passed through on an addenda record. For `wire`
444
493
  # payments the field will be passed through as the "Originator to Beneficiary
445
494
  # Information", also known as OBI or Fedwire tag 6000.
@@ -482,7 +531,10 @@ module ModernTreasury
482
531
  ModernTreasury::PaymentOrderCreateAsyncParams::Direction::OrSymbol,
483
532
  originating_account_id: String,
484
533
  type: ModernTreasury::PaymentOrderType::OrSymbol,
534
+ accounting:
535
+ ModernTreasury::PaymentOrderCreateAsyncParams::Accounting,
485
536
  accounting_category_id: T.nilable(String),
537
+ accounting_ledger_class_id: T.nilable(String),
486
538
  charge_bearer:
487
539
  T.nilable(
488
540
  ModernTreasury::PaymentOrderCreateAsyncParams::ChargeBearer::OrSymbol
@@ -512,6 +564,8 @@ module ModernTreasury
512
564
  receiving_account:
513
565
  ModernTreasury::PaymentOrderCreateAsyncParams::ReceivingAccount,
514
566
  receiving_account_id: String,
567
+ reconciliation_status:
568
+ ModernTreasury::PaymentOrderCreateAsyncParams::ReconciliationStatus::OrSymbol,
515
569
  remittance_information: T.nilable(String),
516
570
  send_remittance_advice: T.nilable(T::Boolean),
517
571
  statement_descriptor: T.nilable(String),
@@ -566,6 +620,52 @@ module ModernTreasury
566
620
  end
567
621
  end
568
622
 
623
+ class Accounting < ModernTreasury::Internal::Type::BaseModel
624
+ OrHash =
625
+ T.type_alias do
626
+ T.any(
627
+ ModernTreasury::PaymentOrderCreateAsyncParams::Accounting,
628
+ ModernTreasury::Internal::AnyHash
629
+ )
630
+ end
631
+
632
+ # The ID of one of your accounting categories. Note that these will only be
633
+ # accessible if your accounting system has been connected.
634
+ sig { returns(T.nilable(String)) }
635
+ attr_accessor :account_id
636
+
637
+ # The ID of one of the class objects in your accounting system. Class objects
638
+ # track segments of your business independent of client or project. Note that
639
+ # these will only be accessible if your accounting system has been connected.
640
+ sig { returns(T.nilable(String)) }
641
+ attr_accessor :class_id
642
+
643
+ sig do
644
+ params(
645
+ account_id: T.nilable(String),
646
+ class_id: T.nilable(String)
647
+ ).returns(T.attached_class)
648
+ end
649
+ def self.new(
650
+ # The ID of one of your accounting categories. Note that these will only be
651
+ # accessible if your accounting system has been connected.
652
+ account_id: nil,
653
+ # The ID of one of the class objects in your accounting system. Class objects
654
+ # track segments of your business independent of client or project. Note that
655
+ # these will only be accessible if your accounting system has been connected.
656
+ class_id: nil
657
+ )
658
+ end
659
+
660
+ sig do
661
+ override.returns(
662
+ { account_id: T.nilable(String), class_id: T.nilable(String) }
663
+ )
664
+ end
665
+ def to_hash
666
+ end
667
+ end
668
+
569
669
  # The party that will pay the fees for the payment order. See
570
670
  # https://docs.moderntreasury.com/payments/docs/charge-bearer to understand the
571
671
  # differences between the options.
@@ -1605,6 +1705,46 @@ module ModernTreasury
1605
1705
  end
1606
1706
  end
1607
1707
  end
1708
+
1709
+ # One of `unreconciled`, `tentatively_reconciled` or `reconciled`.
1710
+ module ReconciliationStatus
1711
+ extend ModernTreasury::Internal::Type::Enum
1712
+
1713
+ TaggedSymbol =
1714
+ T.type_alias do
1715
+ T.all(
1716
+ Symbol,
1717
+ ModernTreasury::PaymentOrderCreateAsyncParams::ReconciliationStatus
1718
+ )
1719
+ end
1720
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1721
+
1722
+ UNRECONCILED =
1723
+ T.let(
1724
+ :unreconciled,
1725
+ ModernTreasury::PaymentOrderCreateAsyncParams::ReconciliationStatus::TaggedSymbol
1726
+ )
1727
+ TENTATIVELY_RECONCILED =
1728
+ T.let(
1729
+ :tentatively_reconciled,
1730
+ ModernTreasury::PaymentOrderCreateAsyncParams::ReconciliationStatus::TaggedSymbol
1731
+ )
1732
+ RECONCILED =
1733
+ T.let(
1734
+ :reconciled,
1735
+ ModernTreasury::PaymentOrderCreateAsyncParams::ReconciliationStatus::TaggedSymbol
1736
+ )
1737
+
1738
+ sig do
1739
+ override.returns(
1740
+ T::Array[
1741
+ ModernTreasury::PaymentOrderCreateAsyncParams::ReconciliationStatus::TaggedSymbol
1742
+ ]
1743
+ )
1744
+ end
1745
+ def self.values
1746
+ end
1747
+ end
1608
1748
  end
1609
1749
  end
1610
1750
  end