e-invoice-api 0.33.0 → 0.35.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 (139) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/LICENSE +201 -0
  4. data/README.md +18 -7
  5. data/SECURITY.md +6 -16
  6. data/lib/e_invoice_api/client.rb +16 -0
  7. data/lib/e_invoice_api/internal/transport/base_client.rb +43 -78
  8. data/lib/e_invoice_api/internal/transport/pooled_net_requester.rb +8 -8
  9. data/lib/e_invoice_api/internal/type/array_of.rb +12 -12
  10. data/lib/e_invoice_api/internal/type/base_model.rb +18 -18
  11. data/lib/e_invoice_api/internal/type/boolean.rb +6 -6
  12. data/lib/e_invoice_api/internal/type/converter.rb +24 -24
  13. data/lib/e_invoice_api/internal/type/enum.rb +6 -6
  14. data/lib/e_invoice_api/internal/type/file_input.rb +6 -6
  15. data/lib/e_invoice_api/internal/type/hash_of.rb +12 -12
  16. data/lib/e_invoice_api/internal/type/request_parameters.rb +1 -1
  17. data/lib/e_invoice_api/internal/type/union.rb +10 -10
  18. data/lib/e_invoice_api/internal/type/unknown.rb +6 -6
  19. data/lib/e_invoice_api/internal/util.rb +15 -57
  20. data/lib/e_invoice_api/models/conversion/document_create_from_pdf_task.rb +43 -0
  21. data/lib/e_invoice_api/models/conversion/pdf_create_params.rb +22 -0
  22. data/lib/e_invoice_api/models/conversion/pdf_result_params.rb +22 -0
  23. data/lib/e_invoice_api/models/conversion/pdf_retrieve_params.rb +22 -0
  24. data/lib/e_invoice_api/models/document_create.rb +203 -17
  25. data/lib/e_invoice_api/models/document_create_from_pdf_response.rb +153 -17
  26. data/lib/e_invoice_api/models/document_lifecycle_params.rb +20 -0
  27. data/lib/e_invoice_api/models/document_lifecycle_response.rb +134 -0
  28. data/lib/e_invoice_api/models/document_response.rb +161 -21
  29. data/lib/e_invoice_api/models/document_timeline_params.rb +20 -0
  30. data/lib/e_invoice_api/models/document_timeline_response.rb +71 -0
  31. data/lib/e_invoice_api/models/draft_list_params.rb +113 -0
  32. data/lib/e_invoice_api/models/inbound_email_response.rb +129 -0
  33. data/lib/e_invoice_api/models/mailbox_download_attachment_params.rb +26 -0
  34. data/lib/e_invoice_api/models/mailbox_list_params.rb +129 -0
  35. data/lib/e_invoice_api/models/mailbox_reprocess_params.rb +20 -0
  36. data/lib/e_invoice_api/models/mailbox_retrieve_params.rb +20 -0
  37. data/lib/e_invoice_api/models/me_retrieve_response.rb +8 -7
  38. data/lib/e_invoice_api/models/payment_detail_create.rb +8 -4
  39. data/lib/e_invoice_api/models/stats_retrieve_params.rb +55 -0
  40. data/lib/e_invoice_api/models/stats_retrieve_response.rb +141 -0
  41. data/lib/e_invoice_api/models/ubl_document_validation.rb +10 -1
  42. data/lib/e_invoice_api/models/unit_of_measure_code.rb +1349 -0
  43. data/lib/e_invoice_api/models/webhook_history_params.rb +20 -0
  44. data/lib/e_invoice_api/models/webhook_history_response.rb +17 -0
  45. data/lib/e_invoice_api/models/webhook_test_params.rb +37 -0
  46. data/lib/e_invoice_api/models/webhook_test_response.rb +35 -0
  47. data/lib/e_invoice_api/models.rb +24 -0
  48. data/lib/e_invoice_api/resources/conversion/pdf.rb +76 -0
  49. data/lib/e_invoice_api/resources/conversion.rb +18 -0
  50. data/lib/e_invoice_api/resources/documents/attachments.rb +11 -11
  51. data/lib/e_invoice_api/resources/documents/ubl.rb +4 -4
  52. data/lib/e_invoice_api/resources/documents.rb +130 -69
  53. data/lib/e_invoice_api/resources/drafts.rb +55 -0
  54. data/lib/e_invoice_api/resources/inbox.rb +20 -20
  55. data/lib/e_invoice_api/resources/lookup.rb +5 -5
  56. data/lib/e_invoice_api/resources/mailbox.rb +123 -0
  57. data/lib/e_invoice_api/resources/me.rb +1 -1
  58. data/lib/e_invoice_api/resources/outbox.rb +19 -19
  59. data/lib/e_invoice_api/resources/stats.rb +47 -0
  60. data/lib/e_invoice_api/resources/validate.rb +76 -56
  61. data/lib/e_invoice_api/resources/webhooks.rb +59 -14
  62. data/lib/e_invoice_api/version.rb +1 -1
  63. data/lib/e_invoice_api.rb +25 -1
  64. data/rbi/e_invoice_api/client.rbi +12 -0
  65. data/rbi/e_invoice_api/internal/transport/base_client.rbi +2 -10
  66. data/rbi/e_invoice_api/internal/util.rbi +0 -12
  67. data/rbi/e_invoice_api/models/conversion/document_create_from_pdf_task.rbi +108 -0
  68. data/rbi/e_invoice_api/models/conversion/pdf_create_params.rbi +43 -0
  69. data/rbi/e_invoice_api/models/conversion/pdf_result_params.rbi +40 -0
  70. data/rbi/e_invoice_api/models/conversion/pdf_retrieve_params.rbi +40 -0
  71. data/rbi/e_invoice_api/models/document_create.rbi +366 -15
  72. data/rbi/e_invoice_api/models/document_create_from_pdf_response.rbi +280 -15
  73. data/rbi/e_invoice_api/models/document_lifecycle_params.rbi +38 -0
  74. data/rbi/e_invoice_api/models/document_lifecycle_response.rbi +353 -0
  75. data/rbi/e_invoice_api/models/document_response.rbi +292 -19
  76. data/rbi/e_invoice_api/models/document_timeline_params.rbi +38 -0
  77. data/rbi/e_invoice_api/models/document_timeline_response.rbi +168 -0
  78. data/rbi/e_invoice_api/models/draft_list_params.rbi +194 -0
  79. data/rbi/e_invoice_api/models/inbound_email_response.rbi +189 -0
  80. data/rbi/e_invoice_api/models/mailbox_download_attachment_params.rbi +46 -0
  81. data/rbi/e_invoice_api/models/mailbox_list_params.rbi +218 -0
  82. data/rbi/e_invoice_api/models/mailbox_reprocess_params.rbi +41 -0
  83. data/rbi/e_invoice_api/models/mailbox_retrieve_params.rbi +41 -0
  84. data/rbi/e_invoice_api/models/me_retrieve_response.rbi +10 -8
  85. data/rbi/e_invoice_api/models/payment_detail_create.rbi +12 -4
  86. data/rbi/e_invoice_api/models/stats_retrieve_params.rbi +111 -0
  87. data/rbi/e_invoice_api/models/stats_retrieve_response.rbi +251 -0
  88. data/rbi/e_invoice_api/models/ubl_document_validation.rbi +11 -1
  89. data/rbi/e_invoice_api/models/unit_of_measure_code.rbi +1349 -0
  90. data/rbi/e_invoice_api/models/webhook_history_params.rbi +38 -0
  91. data/rbi/e_invoice_api/models/webhook_history_response.rbi +32 -0
  92. data/rbi/e_invoice_api/models/webhook_test_params.rbi +57 -0
  93. data/rbi/e_invoice_api/models/webhook_test_response.rbi +57 -0
  94. data/rbi/e_invoice_api/models.rbi +25 -0
  95. data/rbi/e_invoice_api/resources/conversion/pdf.rbi +44 -0
  96. data/rbi/e_invoice_api/resources/conversion.rbi +15 -0
  97. data/rbi/e_invoice_api/resources/documents.rbi +77 -5
  98. data/rbi/e_invoice_api/resources/drafts.rbi +55 -0
  99. data/rbi/e_invoice_api/resources/mailbox.rbi +93 -0
  100. data/rbi/e_invoice_api/resources/stats.rbi +38 -0
  101. data/rbi/e_invoice_api/resources/validate.rbi +52 -6
  102. data/rbi/e_invoice_api/resources/webhooks.rbi +29 -0
  103. data/sig/e_invoice_api/client.rbs +8 -0
  104. data/sig/e_invoice_api/internal/transport/base_client.rbs +1 -4
  105. data/sig/e_invoice_api/internal/util.rbs +0 -4
  106. data/sig/e_invoice_api/models/conversion/document_create_from_pdf_task.rbs +45 -0
  107. data/sig/e_invoice_api/models/conversion/pdf_create_params.rbs +26 -0
  108. data/sig/e_invoice_api/models/conversion/pdf_result_params.rbs +25 -0
  109. data/sig/e_invoice_api/models/conversion/pdf_retrieve_params.rbs +25 -0
  110. data/sig/e_invoice_api/models/document_create.rbs +139 -4
  111. data/sig/e_invoice_api/models/document_create_from_pdf_response.rbs +113 -4
  112. data/sig/e_invoice_api/models/document_lifecycle_params.rbs +23 -0
  113. data/sig/e_invoice_api/models/document_lifecycle_response.rbs +151 -0
  114. data/sig/e_invoice_api/models/document_response.rbs +113 -4
  115. data/sig/e_invoice_api/models/document_timeline_params.rbs +23 -0
  116. data/sig/e_invoice_api/models/document_timeline_response.rbs +84 -0
  117. data/sig/e_invoice_api/models/draft_list_params.rbs +112 -0
  118. data/sig/e_invoice_api/models/inbound_email_response.rbs +126 -0
  119. data/sig/e_invoice_api/models/mailbox_download_attachment_params.rbs +28 -0
  120. data/sig/e_invoice_api/models/mailbox_list_params.rbs +112 -0
  121. data/sig/e_invoice_api/models/mailbox_reprocess_params.rbs +24 -0
  122. data/sig/e_invoice_api/models/mailbox_retrieve_params.rbs +24 -0
  123. data/sig/e_invoice_api/models/stats_retrieve_params.rbs +48 -0
  124. data/sig/e_invoice_api/models/stats_retrieve_response.rbs +107 -0
  125. data/sig/e_invoice_api/models/unit_of_measure_code.rbs +2698 -0
  126. data/sig/e_invoice_api/models/webhook_history_params.rbs +23 -0
  127. data/sig/e_invoice_api/models/webhook_history_response.rbs +13 -0
  128. data/sig/e_invoice_api/models/webhook_test_params.rbs +32 -0
  129. data/sig/e_invoice_api/models/webhook_test_response.rbs +30 -0
  130. data/sig/e_invoice_api/models.rbs +24 -0
  131. data/sig/e_invoice_api/resources/conversion/pdf.rbs +24 -0
  132. data/sig/e_invoice_api/resources/conversion.rbs +9 -0
  133. data/sig/e_invoice_api/resources/documents.rbs +19 -0
  134. data/sig/e_invoice_api/resources/drafts.rbs +20 -0
  135. data/sig/e_invoice_api/resources/mailbox.rbs +36 -0
  136. data/sig/e_invoice_api/resources/stats.rbs +14 -0
  137. data/sig/e_invoice_api/resources/validate.rbs +9 -0
  138. data/sig/e_invoice_api/resources/webhooks.rbs +12 -0
  139. metadata +102 -7
@@ -0,0 +1,218 @@
1
+ # typed: strong
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ class MailboxListParams < EInvoiceAPI::Internal::Type::BaseModel
6
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
7
+ include EInvoiceAPI::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(EInvoiceAPI::MailboxListParams, EInvoiceAPI::Internal::AnyHash)
12
+ end
13
+
14
+ # Page number
15
+ sig { returns(T.nilable(Integer)) }
16
+ attr_reader :page
17
+
18
+ sig { params(page: Integer).void }
19
+ attr_writer :page
20
+
21
+ # Number of items per page
22
+ sig { returns(T.nilable(Integer)) }
23
+ attr_reader :page_size
24
+
25
+ sig { params(page_size: Integer).void }
26
+ attr_writer :page_size
27
+
28
+ # Filter by processing status. If not provided, returns all. Ignored when `status`
29
+ # is set.
30
+ sig { returns(T.nilable(T::Boolean)) }
31
+ attr_accessor :processed
32
+
33
+ # Inclusive lower bound on received date (falls back to created_at when
34
+ # received_at is null)
35
+ sig { returns(T.nilable(Time)) }
36
+ attr_accessor :received_from
37
+
38
+ # Inclusive upper bound on received date (falls back to created_at when
39
+ # received_at is null)
40
+ sig { returns(T.nilable(Time)) }
41
+ attr_accessor :received_to
42
+
43
+ # Case-insensitive search across sender email, subject, message ID, and attachment
44
+ # filenames
45
+ sig { returns(T.nilable(String)) }
46
+ attr_accessor :search
47
+
48
+ # Field to sort by
49
+ sig do
50
+ returns(T.nilable(EInvoiceAPI::MailboxListParams::SortBy::OrSymbol))
51
+ end
52
+ attr_reader :sort_by
53
+
54
+ sig do
55
+ params(sort_by: EInvoiceAPI::MailboxListParams::SortBy::OrSymbol).void
56
+ end
57
+ attr_writer :sort_by
58
+
59
+ # Sort direction (asc/desc)
60
+ sig do
61
+ returns(T.nilable(EInvoiceAPI::MailboxListParams::SortOrder::OrSymbol))
62
+ end
63
+ attr_reader :sort_order
64
+
65
+ sig do
66
+ params(
67
+ sort_order: EInvoiceAPI::MailboxListParams::SortOrder::OrSymbol
68
+ ).void
69
+ end
70
+ attr_writer :sort_order
71
+
72
+ # Filter by status: pending, success, or failed. Takes precedence over `processed`
73
+ # if both are provided.
74
+ sig do
75
+ returns(T.nilable(EInvoiceAPI::MailboxListParams::Status::OrSymbol))
76
+ end
77
+ attr_accessor :status
78
+
79
+ sig do
80
+ params(
81
+ page: Integer,
82
+ page_size: Integer,
83
+ processed: T.nilable(T::Boolean),
84
+ received_from: T.nilable(Time),
85
+ received_to: T.nilable(Time),
86
+ search: T.nilable(String),
87
+ sort_by: EInvoiceAPI::MailboxListParams::SortBy::OrSymbol,
88
+ sort_order: EInvoiceAPI::MailboxListParams::SortOrder::OrSymbol,
89
+ status: T.nilable(EInvoiceAPI::MailboxListParams::Status::OrSymbol),
90
+ request_options: EInvoiceAPI::RequestOptions::OrHash
91
+ ).returns(T.attached_class)
92
+ end
93
+ def self.new(
94
+ # Page number
95
+ page: nil,
96
+ # Number of items per page
97
+ page_size: nil,
98
+ # Filter by processing status. If not provided, returns all. Ignored when `status`
99
+ # is set.
100
+ processed: nil,
101
+ # Inclusive lower bound on received date (falls back to created_at when
102
+ # received_at is null)
103
+ received_from: nil,
104
+ # Inclusive upper bound on received date (falls back to created_at when
105
+ # received_at is null)
106
+ received_to: nil,
107
+ # Case-insensitive search across sender email, subject, message ID, and attachment
108
+ # filenames
109
+ search: nil,
110
+ # Field to sort by
111
+ sort_by: nil,
112
+ # Sort direction (asc/desc)
113
+ sort_order: nil,
114
+ # Filter by status: pending, success, or failed. Takes precedence over `processed`
115
+ # if both are provided.
116
+ status: nil,
117
+ request_options: {}
118
+ )
119
+ end
120
+
121
+ sig do
122
+ override.returns(
123
+ {
124
+ page: Integer,
125
+ page_size: Integer,
126
+ processed: T.nilable(T::Boolean),
127
+ received_from: T.nilable(Time),
128
+ received_to: T.nilable(Time),
129
+ search: T.nilable(String),
130
+ sort_by: EInvoiceAPI::MailboxListParams::SortBy::OrSymbol,
131
+ sort_order: EInvoiceAPI::MailboxListParams::SortOrder::OrSymbol,
132
+ status: T.nilable(EInvoiceAPI::MailboxListParams::Status::OrSymbol),
133
+ request_options: EInvoiceAPI::RequestOptions
134
+ }
135
+ )
136
+ end
137
+ def to_hash
138
+ end
139
+
140
+ # Field to sort by
141
+ module SortBy
142
+ extend EInvoiceAPI::Internal::Type::Enum
143
+
144
+ TaggedSymbol =
145
+ T.type_alias { T.all(Symbol, EInvoiceAPI::MailboxListParams::SortBy) }
146
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
147
+
148
+ RECEIVED_AT =
149
+ T.let(
150
+ :received_at,
151
+ EInvoiceAPI::MailboxListParams::SortBy::TaggedSymbol
152
+ )
153
+ CREATED_AT =
154
+ T.let(
155
+ :created_at,
156
+ EInvoiceAPI::MailboxListParams::SortBy::TaggedSymbol
157
+ )
158
+
159
+ sig do
160
+ override.returns(
161
+ T::Array[EInvoiceAPI::MailboxListParams::SortBy::TaggedSymbol]
162
+ )
163
+ end
164
+ def self.values
165
+ end
166
+ end
167
+
168
+ # Sort direction (asc/desc)
169
+ module SortOrder
170
+ extend EInvoiceAPI::Internal::Type::Enum
171
+
172
+ TaggedSymbol =
173
+ T.type_alias do
174
+ T.all(Symbol, EInvoiceAPI::MailboxListParams::SortOrder)
175
+ end
176
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
177
+
178
+ ASC =
179
+ T.let(:asc, EInvoiceAPI::MailboxListParams::SortOrder::TaggedSymbol)
180
+ DESC =
181
+ T.let(:desc, EInvoiceAPI::MailboxListParams::SortOrder::TaggedSymbol)
182
+
183
+ sig do
184
+ override.returns(
185
+ T::Array[EInvoiceAPI::MailboxListParams::SortOrder::TaggedSymbol]
186
+ )
187
+ end
188
+ def self.values
189
+ end
190
+ end
191
+
192
+ # Filter by status: pending, success, or failed. Takes precedence over `processed`
193
+ # if both are provided.
194
+ module Status
195
+ extend EInvoiceAPI::Internal::Type::Enum
196
+
197
+ TaggedSymbol =
198
+ T.type_alias { T.all(Symbol, EInvoiceAPI::MailboxListParams::Status) }
199
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
200
+
201
+ PENDING =
202
+ T.let(:pending, EInvoiceAPI::MailboxListParams::Status::TaggedSymbol)
203
+ SUCCESS =
204
+ T.let(:success, EInvoiceAPI::MailboxListParams::Status::TaggedSymbol)
205
+ FAILED =
206
+ T.let(:failed, EInvoiceAPI::MailboxListParams::Status::TaggedSymbol)
207
+
208
+ sig do
209
+ override.returns(
210
+ T::Array[EInvoiceAPI::MailboxListParams::Status::TaggedSymbol]
211
+ )
212
+ end
213
+ def self.values
214
+ end
215
+ end
216
+ end
217
+ end
218
+ end
@@ -0,0 +1,41 @@
1
+ # typed: strong
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ class MailboxReprocessParams < EInvoiceAPI::Internal::Type::BaseModel
6
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
7
+ include EInvoiceAPI::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ EInvoiceAPI::MailboxReprocessParams,
13
+ EInvoiceAPI::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :inbound_email_id
19
+
20
+ sig do
21
+ params(
22
+ inbound_email_id: String,
23
+ request_options: EInvoiceAPI::RequestOptions::OrHash
24
+ ).returns(T.attached_class)
25
+ end
26
+ def self.new(inbound_email_id:, request_options: {})
27
+ end
28
+
29
+ sig do
30
+ override.returns(
31
+ {
32
+ inbound_email_id: String,
33
+ request_options: EInvoiceAPI::RequestOptions
34
+ }
35
+ )
36
+ end
37
+ def to_hash
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,41 @@
1
+ # typed: strong
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ class MailboxRetrieveParams < EInvoiceAPI::Internal::Type::BaseModel
6
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
7
+ include EInvoiceAPI::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ EInvoiceAPI::MailboxRetrieveParams,
13
+ EInvoiceAPI::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :inbound_email_id
19
+
20
+ sig do
21
+ params(
22
+ inbound_email_id: String,
23
+ request_options: EInvoiceAPI::RequestOptions::OrHash
24
+ ).returns(T.attached_class)
25
+ end
26
+ def self.new(inbound_email_id:, request_options: {})
27
+ end
28
+
29
+ sig do
30
+ override.returns(
31
+ {
32
+ inbound_email_id: String,
33
+ request_options: EInvoiceAPI::RequestOptions
34
+ }
35
+ )
36
+ end
37
+ def to_hash
38
+ end
39
+ end
40
+ end
41
+ end
@@ -44,8 +44,8 @@ module EInvoiceAPI
44
44
  sig { returns(T.nilable(String)) }
45
45
  attr_accessor :company_number
46
46
 
47
- # Company tax ID. For Belgium this is the VAT number. Must include the country
48
- # prefix
47
+ # Company tax ID (VAT number), including the country prefix. Stored in compact
48
+ # form: uppercased with separators removed, e.g. `BE0123456789`.
49
49
  sig { returns(T.nilable(String)) }
50
50
  attr_accessor :company_tax_id
51
51
 
@@ -86,11 +86,12 @@ module EInvoiceAPI
86
86
  end
87
87
  attr_writer :plan
88
88
 
89
- # Whether the tenant is registered on our SMP
89
+ # Legacy field. Does not show whether a Peppol ID is published: it is usually
90
+ # `false`, also for a tenant whose Peppol IDs are published.
90
91
  sig { returns(T.nilable(T::Boolean)) }
91
92
  attr_accessor :smp_registration
92
93
 
93
- # Date when the tenant was registered on SMP
94
+ # Legacy field. Does not show whether or when a Peppol ID was published.
94
95
  sig { returns(T.nilable(Time)) }
95
96
  attr_accessor :smp_registration_date
96
97
 
@@ -133,8 +134,8 @@ module EInvoiceAPI
133
134
  # Company number. For Belgium this is the CBE number or their EUID (European
134
135
  # Unique Identifier) number
135
136
  company_number: nil,
136
- # Company tax ID. For Belgium this is the VAT number. Must include the country
137
- # prefix
137
+ # Company tax ID (VAT number), including the country prefix. Stored in compact
138
+ # form: uppercased with separators removed, e.g. `BE0123456789`.
138
139
  company_tax_id: nil,
139
140
  # Zip code of the company
140
141
  company_zip: nil,
@@ -147,9 +148,10 @@ module EInvoiceAPI
147
148
  peppol_ids: nil,
148
149
  # Plan of the tenant
149
150
  plan: nil,
150
- # Whether the tenant is registered on our SMP
151
+ # Legacy field. Does not show whether a Peppol ID is published: it is usually
152
+ # `false`, also for a tenant whose Peppol IDs are published.
151
153
  smp_registration: nil,
152
- # Date when the tenant was registered on SMP
154
+ # Legacy field. Does not show whether or when a Peppol ID was published.
153
155
  smp_registration_date: nil
154
156
  )
155
157
  end
@@ -11,7 +11,9 @@ module EInvoiceAPI
11
11
  )
12
12
  end
13
13
 
14
- # Bank account number (for non-IBAN accounts)
14
+ # Bank account number (for non-IBAN accounts). With `swift` `SE:BANKGIRO` or
15
+ # `SE:PLUSGIRO`, the bankgiro or plusgiro number, with `iban` left empty; spaces
16
+ # and hyphens are removed.
15
17
  sig { returns(T.nilable(String)) }
16
18
  attr_accessor :bank_account_number
17
19
 
@@ -24,7 +26,9 @@ module EInvoiceAPI
24
26
  sig { returns(T.nilable(String)) }
25
27
  attr_accessor :payment_reference
26
28
 
27
- # SWIFT/BIC code of the bank
29
+ # The payment service provider identifier (BT-86): the BIC of the payee's bank, or
30
+ # `SE:BANKGIRO` / `SE:PLUSGIRO` when `bank_account_number` is a Swedish bankgiro
31
+ # or plusgiro number.
28
32
  sig { returns(T.nilable(String)) }
29
33
  attr_accessor :swift
30
34
 
@@ -37,14 +41,18 @@ module EInvoiceAPI
37
41
  ).returns(T.attached_class)
38
42
  end
39
43
  def self.new(
40
- # Bank account number (for non-IBAN accounts)
44
+ # Bank account number (for non-IBAN accounts). With `swift` `SE:BANKGIRO` or
45
+ # `SE:PLUSGIRO`, the bankgiro or plusgiro number, with `iban` left empty; spaces
46
+ # and hyphens are removed.
41
47
  bank_account_number: nil,
42
48
  # International Bank Account Number for payment transfers
43
49
  iban: nil,
44
50
  # Structured payment reference or communication (e.g., structured communication
45
51
  # for Belgian bank transfers)
46
52
  payment_reference: nil,
47
- # SWIFT/BIC code of the bank
53
+ # The payment service provider identifier (BT-86): the BIC of the payee's bank, or
54
+ # `SE:BANKGIRO` / `SE:PLUSGIRO` when `bank_account_number` is a Swedish bankgiro
55
+ # or plusgiro number.
48
56
  swift: nil
49
57
  )
50
58
  end
@@ -0,0 +1,111 @@
1
+ # typed: strong
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ class StatsRetrieveParams < EInvoiceAPI::Internal::Type::BaseModel
6
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
7
+ include EInvoiceAPI::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ EInvoiceAPI::StatsRetrieveParams,
13
+ EInvoiceAPI::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # Aggregation type: DAY, WEEK, or MONTH. Defaults to DAY.
18
+ sig do
19
+ returns(
20
+ T.nilable(EInvoiceAPI::StatsRetrieveParams::Aggregation::OrSymbol)
21
+ )
22
+ end
23
+ attr_accessor :aggregation
24
+
25
+ # End date in yyyy-mm-dd format. If not provided, queries to latest available
26
+ # data.
27
+ sig { returns(T.nilable(Date)) }
28
+ attr_accessor :end_date
29
+
30
+ # Start date in yyyy-mm-dd format. If not provided, queries from earliest
31
+ # available data.
32
+ sig { returns(T.nilable(Date)) }
33
+ attr_accessor :start_date
34
+
35
+ sig do
36
+ params(
37
+ aggregation:
38
+ T.nilable(EInvoiceAPI::StatsRetrieveParams::Aggregation::OrSymbol),
39
+ end_date: T.nilable(Date),
40
+ start_date: T.nilable(Date),
41
+ request_options: EInvoiceAPI::RequestOptions::OrHash
42
+ ).returns(T.attached_class)
43
+ end
44
+ def self.new(
45
+ # Aggregation type: DAY, WEEK, or MONTH. Defaults to DAY.
46
+ aggregation: nil,
47
+ # End date in yyyy-mm-dd format. If not provided, queries to latest available
48
+ # data.
49
+ end_date: nil,
50
+ # Start date in yyyy-mm-dd format. If not provided, queries from earliest
51
+ # available data.
52
+ start_date: nil,
53
+ request_options: {}
54
+ )
55
+ end
56
+
57
+ sig do
58
+ override.returns(
59
+ {
60
+ aggregation:
61
+ T.nilable(
62
+ EInvoiceAPI::StatsRetrieveParams::Aggregation::OrSymbol
63
+ ),
64
+ end_date: T.nilable(Date),
65
+ start_date: T.nilable(Date),
66
+ request_options: EInvoiceAPI::RequestOptions
67
+ }
68
+ )
69
+ end
70
+ def to_hash
71
+ end
72
+
73
+ # Aggregation type: DAY, WEEK, or MONTH. Defaults to DAY.
74
+ module Aggregation
75
+ extend EInvoiceAPI::Internal::Type::Enum
76
+
77
+ TaggedSymbol =
78
+ T.type_alias do
79
+ T.all(Symbol, EInvoiceAPI::StatsRetrieveParams::Aggregation)
80
+ end
81
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
82
+
83
+ DAY =
84
+ T.let(
85
+ :DAY,
86
+ EInvoiceAPI::StatsRetrieveParams::Aggregation::TaggedSymbol
87
+ )
88
+ WEEK =
89
+ T.let(
90
+ :WEEK,
91
+ EInvoiceAPI::StatsRetrieveParams::Aggregation::TaggedSymbol
92
+ )
93
+ MONTH =
94
+ T.let(
95
+ :MONTH,
96
+ EInvoiceAPI::StatsRetrieveParams::Aggregation::TaggedSymbol
97
+ )
98
+
99
+ sig do
100
+ override.returns(
101
+ T::Array[
102
+ EInvoiceAPI::StatsRetrieveParams::Aggregation::TaggedSymbol
103
+ ]
104
+ )
105
+ end
106
+ def self.values
107
+ end
108
+ end
109
+ end
110
+ end
111
+ end