facturx 0.2.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +43 -3
  3. data/DOCUMENTATION.md +271 -0
  4. data/README.md +79 -69
  5. data/lib/facturx/attach.rb +4 -20
  6. data/lib/facturx/builders/association.rb +8 -0
  7. data/lib/facturx/builders/base.rb +129 -0
  8. data/lib/facturx/builders/schema.rb +112 -0
  9. data/lib/facturx/builders.rb +25 -0
  10. data/lib/facturx/error.rb +7 -1
  11. data/lib/facturx/format.rb +85 -0
  12. data/lib/facturx/generate.rb +21 -0
  13. data/lib/facturx/pdf/composer.rb +32 -0
  14. data/lib/facturx/profile.rb +1 -1
  15. data/lib/facturx/profile_resolver.rb +40 -0
  16. data/lib/facturx/profiles.rb +1 -8
  17. data/lib/facturx/reader/semantic_mapper/line_mapping.rb +1 -1
  18. data/lib/facturx/reader/semantic_mapper/line_references.rb +19 -0
  19. data/lib/facturx/reader/semantic_mapper/payment_mapping.rb +48 -11
  20. data/lib/facturx/reader/semantic_mapper.rb +9 -0
  21. data/lib/facturx/reader/term_reader.rb +12 -4
  22. data/lib/facturx/reader.rb +3 -7
  23. data/lib/facturx/source_reader.rb +1 -1
  24. data/lib/facturx/validation.rb +61 -0
  25. data/lib/facturx/version.rb +1 -1
  26. data/lib/facturx/writer/context.rb +53 -0
  27. data/lib/facturx/writer/stage.rb +47 -0
  28. data/lib/facturx/writer/stage_support/contact_details.rb +57 -0
  29. data/lib/facturx/writer/stage_support/emission.rb +78 -0
  30. data/lib/facturx/writer/stage_support/identifiers.rb +129 -0
  31. data/lib/facturx/writer/stage_support/structure.rb +88 -0
  32. data/lib/facturx/writer/stages/document_context.rb +31 -0
  33. data/lib/facturx/writer/stages/exchanged_document.rb +32 -0
  34. data/lib/facturx/writer/stages/trade_agreement/parties.rb +105 -0
  35. data/lib/facturx/writer/stages/trade_agreement/references.rb +92 -0
  36. data/lib/facturx/writer/stages/trade_agreement.rb +45 -0
  37. data/lib/facturx/writer/stages/trade_delivery.rb +77 -0
  38. data/lib/facturx/writer/stages/trade_lines/agreement.rb +92 -0
  39. data/lib/facturx/writer/stages/trade_lines/product.rb +78 -0
  40. data/lib/facturx/writer/stages/trade_lines/quantity.rb +17 -0
  41. data/lib/facturx/writer/stages/trade_lines/settlement.rb +89 -0
  42. data/lib/facturx/writer/stages/trade_lines.rb +67 -0
  43. data/lib/facturx/writer/stages/trade_settlement/parties.rb +33 -0
  44. data/lib/facturx/writer/stages/trade_settlement/payment.rb +97 -0
  45. data/lib/facturx/writer/stages/trade_settlement/summary.rb +88 -0
  46. data/lib/facturx/writer/stages/trade_settlement/taxes.rb +121 -0
  47. data/lib/facturx/writer/stages/trade_settlement.rb +70 -0
  48. data/lib/facturx/writer/tracker.rb +131 -0
  49. data/lib/facturx/writer.rb +76 -0
  50. data/lib/facturx/xml/namespaces.rb +19 -0
  51. data/lib/facturx/xml/parser.rb +1 -1
  52. data/lib/facturx/xml/profile_detector.rb +2 -4
  53. data/lib/facturx/xml/report_builder.rb +44 -0
  54. data/lib/facturx/xml/schema_registry.rb +22 -0
  55. data/lib/facturx/xml/schema_validator.rb +7 -2
  56. data/lib/facturx/xml/validator.rb +32 -0
  57. data/lib/facturx/xml/verifier.rb +16 -11
  58. data/lib/facturx.rb +41 -4
  59. data/rbi/facturx.rbi +1755 -0
  60. metadata +44 -4
data/rbi/facturx.rbi ADDED
@@ -0,0 +1,1755 @@
1
+ # typed: strict
2
+
3
+ module Facturx
4
+ VERSION = T.let(T.unsafe(nil), String)
5
+
6
+ class Error < StandardError
7
+ sig { params(message: T.nilable(String), details: T.untyped).void }
8
+ def initialize(message = nil, **details); end
9
+
10
+ sig { returns(T::Hash[Symbol, T.untyped]) }
11
+ attr_reader :details
12
+ end
13
+
14
+ class ValidationError < Error; end
15
+ class InvalidDocumentError < ValidationError; end
16
+ class InvalidXmlError < ValidationError; end
17
+ class UnknownProfileError < InvalidXmlError; end
18
+ class XsdValidationError < InvalidXmlError; end
19
+ class SchemaLoadError < Error; end
20
+ class InvalidSourceError < Error; end
21
+ class UnsupportedProfileError < Error; end
22
+ class InvalidPdfError < Error; end
23
+ class ProtectedPdfError < InvalidPdfError; end
24
+ class ComposerUnavailableError < Error; end
25
+ class CompositionError < Error; end
26
+ class ExtractionError < Error; end
27
+ class VerificationError < Error; end
28
+
29
+ class << self
30
+ sig { params(xml: String).returns(Facturx::Validation::Report) }
31
+ def validate_xml(xml:); end
32
+
33
+ sig { params(pdf: String, xml: String).returns(String) }
34
+ def attach(pdf:, xml:); end
35
+
36
+ sig { params(pdf: String).returns(String) }
37
+ def extract_xml(pdf:); end
38
+
39
+ sig do
40
+ params(source: String, on_unknown_profile: Symbol)
41
+ .returns(Facturx::Reading)
42
+ end
43
+ def read(source, on_unknown_profile: :fallback); end
44
+
45
+ sig do
46
+ params(document: Facturx::Document, profile: T.any(Symbol, Facturx::Profile))
47
+ .returns(Facturx::Validation::Report)
48
+ end
49
+ def validate_document(document:, profile:); end
50
+
51
+ sig { params(document: Facturx::Document, profile: T.any(Symbol, Facturx::Profile)).returns(String) }
52
+ def build_xml(document:, profile:); end
53
+
54
+ sig do
55
+ params(pdf: String, document: Facturx::Document, profile: T.any(Symbol, Facturx::Profile))
56
+ .returns(String)
57
+ end
58
+ def generate(pdf:, document:, profile:); end
59
+ end
60
+
61
+ module Validation
62
+ class Issue
63
+ sig do
64
+ params(
65
+ code: Symbol,
66
+ message: String,
67
+ layer: Symbol,
68
+ severity: Symbol,
69
+ term_id: T.nilable(String),
70
+ group_id: T.nilable(String),
71
+ path: T.nilable(String),
72
+ line: T.nilable(Integer),
73
+ column: T.nilable(Integer),
74
+ details: T::Hash[Symbol, T.untyped]
75
+ ).void
76
+ end
77
+ def initialize(code:, message:, layer:, severity: :error, term_id: nil, group_id: nil, path: nil,
78
+ line: nil, column: nil, details: {}); end
79
+
80
+ sig { returns(Symbol) }
81
+ attr_reader :code, :layer, :severity
82
+
83
+ sig { returns(String) }
84
+ attr_reader :message
85
+
86
+ sig { returns(T.nilable(String)) }
87
+ attr_reader :term_id, :group_id, :path
88
+
89
+ sig { returns(T.nilable(Integer)) }
90
+ attr_reader :line, :column
91
+
92
+ sig { returns(T::Hash[Symbol, T.untyped]) }
93
+ attr_reader :details
94
+
95
+ sig do
96
+ params(
97
+ code: Symbol,
98
+ message: String,
99
+ layer: Symbol,
100
+ severity: Symbol,
101
+ term_id: T.nilable(String),
102
+ group_id: T.nilable(String),
103
+ path: T.nilable(String),
104
+ line: T.nilable(Integer),
105
+ column: T.nilable(Integer),
106
+ details: T::Hash[Symbol, T.untyped]
107
+ ).returns(Facturx::Validation::Issue)
108
+ end
109
+ def with(code: self.code, message: self.message, layer: self.layer, severity: self.severity,
110
+ term_id: self.term_id, group_id: self.group_id, path: self.path, line: self.line,
111
+ column: self.column, details: self.details); end
112
+ end
113
+
114
+ class Report
115
+ sig { params(profile: T.nilable(Facturx::Profile), issues: T::Array[Facturx::Validation::Issue]).void }
116
+ def initialize(profile: nil, issues: []); end
117
+
118
+ sig { returns(T.nilable(Facturx::Profile)) }
119
+ attr_reader :profile
120
+
121
+ sig { returns(T::Array[Facturx::Validation::Issue]) }
122
+ attr_reader :issues
123
+
124
+ sig { returns(T::Boolean) }
125
+ def valid?; end
126
+
127
+ sig { returns(T::Boolean) }
128
+ def invalid?; end
129
+
130
+ sig do
131
+ params(profile: T.nilable(Facturx::Profile), issues: T::Array[Facturx::Validation::Issue])
132
+ .returns(Facturx::Validation::Report)
133
+ end
134
+ def with(profile: self.profile, issues: self.issues); end
135
+ end
136
+ end
137
+
138
+ class Profile
139
+ sig { params(id: Symbol, guideline_urn: String, conformance_level: String).void }
140
+ def initialize(id:, guideline_urn:, conformance_level:); end
141
+
142
+ sig { returns(Symbol) }
143
+ def id; end
144
+
145
+ sig { returns(String) }
146
+ def guideline_urn; end
147
+
148
+ sig { returns(String) }
149
+ def conformance_level; end
150
+
151
+ sig do
152
+ params(id: Symbol, guideline_urn: String, conformance_level: String)
153
+ .returns(Facturx::Profile)
154
+ end
155
+ def with(id: self.id, guideline_urn: self.guideline_urn, conformance_level: self.conformance_level); end
156
+ end
157
+
158
+ module Profiles
159
+ sig { returns(T::Array[Facturx::Profile]) }
160
+ def self.all; end
161
+
162
+ sig { params(id: T.any(String, Symbol)).returns(Facturx::Profile) }
163
+ def self.fetch(id); end
164
+
165
+ sig { params(guideline_urn: String).returns(T.nilable(Facturx::Profile)) }
166
+ def self.for_guideline_urn(guideline_urn); end
167
+ end
168
+
169
+ class Diagnostic
170
+ sig do
171
+ params(
172
+ code: Symbol,
173
+ message: String,
174
+ term_id: T.nilable(String),
175
+ path: T.nilable(String),
176
+ details: T::Hash[Symbol, T.untyped]
177
+ ).void
178
+ end
179
+ def initialize(code:, message:, term_id: nil, path: nil, details: {}); end
180
+
181
+ sig { returns(Symbol) }
182
+ def code; end
183
+
184
+ sig { returns(T.nilable(String)) }
185
+ def term_id; end
186
+
187
+ sig { returns(T.nilable(String)) }
188
+ def path; end
189
+
190
+ sig { returns(String) }
191
+ def message; end
192
+
193
+ sig { returns(T::Hash[T.untyped, T.untyped]) }
194
+ def details; end
195
+
196
+ sig do
197
+ params(
198
+ code: Symbol,
199
+ message: String,
200
+ term_id: T.nilable(String),
201
+ path: T.nilable(String),
202
+ details: T::Hash[Symbol, T.untyped]
203
+ ).returns(Facturx::Diagnostic)
204
+ end
205
+ def with(code: self.code, message: self.message, term_id: self.term_id, path: self.path,
206
+ details: self.details); end
207
+ end
208
+
209
+ class Reading
210
+ sig do
211
+ params(
212
+ document: Facturx::Document,
213
+ profile: Facturx::Profile,
214
+ source: String,
215
+ diagnostics: T::Array[Facturx::Diagnostic],
216
+ source_type: Symbol
217
+ ).void
218
+ end
219
+ def initialize(document:, profile:, source:, diagnostics: [], source_type: :xml); end
220
+
221
+ sig { returns(Facturx::Document) }
222
+ def document; end
223
+
224
+ sig { returns(Facturx::Profile) }
225
+ def profile; end
226
+
227
+ sig { returns(T::Array[Facturx::Diagnostic]) }
228
+ def diagnostics; end
229
+
230
+ sig { returns(String) }
231
+ def source; end
232
+
233
+ sig { returns(Symbol) }
234
+ def source_type; end
235
+
236
+ sig do
237
+ params(
238
+ document: Facturx::Document,
239
+ profile: Facturx::Profile,
240
+ source: String,
241
+ diagnostics: T::Array[Facturx::Diagnostic],
242
+ source_type: Symbol
243
+ ).returns(Facturx::Reading)
244
+ end
245
+ def with(document: self.document, profile: self.profile, source: self.source,
246
+ diagnostics: self.diagnostics, source_type: self.source_type); end
247
+ end
248
+
249
+ class Note
250
+ sig { params(content: T.nilable(String), subject_code: T.nilable(String)).void }
251
+ def initialize(content: nil, subject_code: nil); end
252
+
253
+ sig { returns(T.nilable(String)) }
254
+ attr_reader :content, :subject_code
255
+
256
+ sig { params(content: T.nilable(String), subject_code: T.nilable(String)).returns(Facturx::Note) }
257
+ def with(content: self.content, subject_code: self.subject_code); end
258
+ end
259
+
260
+ class Identifier
261
+ sig { params(value: T.nilable(String), scheme_id: T.nilable(String)).void }
262
+ def initialize(value: nil, scheme_id: nil); end
263
+
264
+ sig { returns(T.nilable(String)) }
265
+ attr_reader :value, :scheme_id
266
+
267
+ sig { params(value: T.nilable(String), scheme_id: T.nilable(String)).returns(Facturx::Identifier) }
268
+ def with(value: self.value, scheme_id: self.scheme_id); end
269
+ end
270
+
271
+ class Period
272
+ sig { params(start_date: T.nilable(::Date), end_date: T.nilable(::Date)).void }
273
+ def initialize(start_date: nil, end_date: nil); end
274
+
275
+ sig { returns(T.nilable(::Date)) }
276
+ attr_reader :start_date, :end_date
277
+
278
+ sig { params(start_date: T.nilable(::Date), end_date: T.nilable(::Date)).returns(Facturx::Period) }
279
+ def with(start_date: self.start_date, end_date: self.end_date); end
280
+ end
281
+
282
+ class Quantity
283
+ sig { params(value: T.nilable(T.any(::BigDecimal, Integer)), unit_code: T.nilable(String)).void }
284
+ def initialize(value: nil, unit_code: nil); end
285
+
286
+ sig { returns(T.nilable(T.any(::BigDecimal, Integer))) }
287
+ attr_reader :value
288
+
289
+ sig { returns(T.nilable(String)) }
290
+ attr_reader :unit_code
291
+
292
+ sig do
293
+ params(value: T.nilable(T.any(::BigDecimal, Integer)), unit_code: T.nilable(String))
294
+ .returns(Facturx::Quantity)
295
+ end
296
+ def with(value: self.value, unit_code: self.unit_code); end
297
+ end
298
+
299
+ class Contact
300
+ sig { params(name: T.nilable(String), telephone: T.nilable(String), email: T.nilable(String)).void }
301
+ def initialize(name: nil, telephone: nil, email: nil); end
302
+
303
+ sig { returns(T.nilable(String)) }
304
+ attr_reader :name, :telephone, :email
305
+
306
+ sig do
307
+ params(name: T.nilable(String), telephone: T.nilable(String), email: T.nilable(String))
308
+ .returns(Facturx::Contact)
309
+ end
310
+ def with(name: self.name, telephone: self.telephone, email: self.email); end
311
+ end
312
+
313
+ class Address
314
+ sig do
315
+ params(
316
+ postcode: T.nilable(String),
317
+ line_one: T.nilable(String),
318
+ line_two: T.nilable(String),
319
+ line_three: T.nilable(String),
320
+ city: T.nilable(String),
321
+ country_code: T.nilable(String),
322
+ country_subdivision: T.nilable(String)
323
+ ).void
324
+ end
325
+ def initialize(postcode: nil, line_one: nil, line_two: nil, line_three: nil, city: nil,
326
+ country_code: nil, country_subdivision: nil); end
327
+
328
+ sig { returns(T.nilable(String)) }
329
+ attr_reader :postcode, :line_one, :line_two, :line_three, :city, :country_code, :country_subdivision
330
+
331
+ sig do
332
+ params(
333
+ postcode: T.nilable(String),
334
+ line_one: T.nilable(String),
335
+ line_two: T.nilable(String),
336
+ line_three: T.nilable(String),
337
+ city: T.nilable(String),
338
+ country_code: T.nilable(String),
339
+ country_subdivision: T.nilable(String)
340
+ ).returns(Facturx::Address)
341
+ end
342
+ def with(postcode: self.postcode, line_one: self.line_one, line_two: self.line_two,
343
+ line_three: self.line_three, city: self.city, country_code: self.country_code,
344
+ country_subdivision: self.country_subdivision); end
345
+ end
346
+
347
+ class Party
348
+ sig do
349
+ params(
350
+ identifiers: T::Array[Facturx::Identifier],
351
+ name: T.nilable(String),
352
+ description: T.nilable(String),
353
+ legal_registration: T.nilable(Facturx::Identifier),
354
+ trading_name: T.nilable(String),
355
+ address: T.nilable(Facturx::Address),
356
+ vat_identifier: T.nilable(Facturx::Identifier),
357
+ tax_identifier: T.nilable(Facturx::Identifier),
358
+ electronic_address: T.nilable(Facturx::Identifier),
359
+ contact: T.nilable(Facturx::Contact)
360
+ ).void
361
+ end
362
+ def initialize(identifiers: [], name: nil, description: nil, legal_registration: nil,
363
+ trading_name: nil, address: nil, vat_identifier: nil, tax_identifier: nil,
364
+ electronic_address: nil, contact: nil); end
365
+
366
+ sig { returns(T.nilable(String)) }
367
+ attr_reader :name, :description, :trading_name
368
+
369
+ sig { returns(T::Array[Facturx::Identifier]) }
370
+ def identifiers; end
371
+
372
+ sig { returns(T.nilable(Facturx::Identifier)) }
373
+ def legal_registration; end
374
+
375
+ sig { returns(T.nilable(Facturx::Address)) }
376
+ def address; end
377
+
378
+ sig { returns(T.nilable(Facturx::Identifier)) }
379
+ def vat_identifier; end
380
+
381
+ sig { returns(T.nilable(Facturx::Identifier)) }
382
+ def tax_identifier; end
383
+
384
+ sig { returns(T.nilable(Facturx::Identifier)) }
385
+ def electronic_address; end
386
+
387
+ sig { returns(T.nilable(Facturx::Contact)) }
388
+ def contact; end
389
+
390
+ sig do
391
+ params(
392
+ identifiers: T::Array[Facturx::Identifier],
393
+ name: T.nilable(String),
394
+ description: T.nilable(String),
395
+ legal_registration: T.nilable(Facturx::Identifier),
396
+ trading_name: T.nilable(String),
397
+ address: T.nilable(Facturx::Address),
398
+ vat_identifier: T.nilable(Facturx::Identifier),
399
+ tax_identifier: T.nilable(Facturx::Identifier),
400
+ electronic_address: T.nilable(Facturx::Identifier),
401
+ contact: T.nilable(Facturx::Contact)
402
+ ).returns(Facturx::Party)
403
+ end
404
+ def with(identifiers: self.identifiers, name: self.name, description: self.description,
405
+ legal_registration: self.legal_registration, trading_name: self.trading_name,
406
+ address: self.address, vat_identifier: self.vat_identifier,
407
+ tax_identifier: self.tax_identifier, electronic_address: self.electronic_address,
408
+ contact: self.contact); end
409
+ end
410
+
411
+ class CreditTransfer
412
+ sig do
413
+ params(
414
+ account_identifier: T.nilable(Facturx::Identifier),
415
+ account_name: T.nilable(String),
416
+ provider_identifier: T.nilable(Facturx::Identifier)
417
+ ).void
418
+ end
419
+ def initialize(account_identifier: nil, account_name: nil, provider_identifier: nil); end
420
+
421
+ sig { returns(T.nilable(String)) }
422
+ attr_reader :account_name
423
+
424
+ sig { returns(T.nilable(Facturx::Identifier)) }
425
+ def account_identifier; end
426
+
427
+ sig { returns(T.nilable(Facturx::Identifier)) }
428
+ def provider_identifier; end
429
+
430
+ sig do
431
+ params(
432
+ account_identifier: T.nilable(Facturx::Identifier),
433
+ account_name: T.nilable(String),
434
+ provider_identifier: T.nilable(Facturx::Identifier)
435
+ ).returns(Facturx::CreditTransfer)
436
+ end
437
+ def with(account_identifier: self.account_identifier, account_name: self.account_name,
438
+ provider_identifier: self.provider_identifier); end
439
+ end
440
+
441
+ class PaymentCard
442
+ sig { params(primary_account_number: T.nilable(String), holder_name: T.nilable(String)).void }
443
+ def initialize(primary_account_number: nil, holder_name: nil); end
444
+
445
+ sig { returns(T.nilable(String)) }
446
+ attr_reader :primary_account_number, :holder_name
447
+
448
+ sig do
449
+ params(primary_account_number: T.nilable(String), holder_name: T.nilable(String))
450
+ .returns(Facturx::PaymentCard)
451
+ end
452
+ def with(primary_account_number: self.primary_account_number, holder_name: self.holder_name); end
453
+ end
454
+
455
+ class DirectDebit
456
+ sig do
457
+ params(
458
+ mandate_identifier: T.nilable(Facturx::Identifier),
459
+ creditor_identifier: T.nilable(Facturx::Identifier),
460
+ debtor_account_identifier: T.nilable(Facturx::Identifier)
461
+ ).void
462
+ end
463
+ def initialize(mandate_identifier: nil, creditor_identifier: nil, debtor_account_identifier: nil); end
464
+
465
+ sig { returns(T.nilable(Facturx::Identifier)) }
466
+ def mandate_identifier; end
467
+
468
+ sig { returns(T.nilable(Facturx::Identifier)) }
469
+ def creditor_identifier; end
470
+
471
+ sig { returns(T.nilable(Facturx::Identifier)) }
472
+ def debtor_account_identifier; end
473
+
474
+ sig do
475
+ params(
476
+ mandate_identifier: T.nilable(Facturx::Identifier),
477
+ creditor_identifier: T.nilable(Facturx::Identifier),
478
+ debtor_account_identifier: T.nilable(Facturx::Identifier)
479
+ ).returns(Facturx::DirectDebit)
480
+ end
481
+ def with(mandate_identifier: self.mandate_identifier, creditor_identifier: self.creditor_identifier,
482
+ debtor_account_identifier: self.debtor_account_identifier); end
483
+ end
484
+
485
+ class PaymentInstructions
486
+ sig do
487
+ params(
488
+ means_code: T.nilable(String),
489
+ means_text: T.nilable(String),
490
+ remittance_information: T.nilable(String),
491
+ credit_transfers: T::Array[Facturx::CreditTransfer],
492
+ payment_card: T.nilable(Facturx::PaymentCard),
493
+ direct_debit: T.nilable(Facturx::DirectDebit)
494
+ ).void
495
+ end
496
+ def initialize(means_code: nil, means_text: nil, remittance_information: nil,
497
+ credit_transfers: [], payment_card: nil, direct_debit: nil); end
498
+
499
+ sig { returns(T.nilable(String)) }
500
+ attr_reader :means_code, :means_text, :remittance_information
501
+
502
+ sig { returns(T::Array[Facturx::CreditTransfer]) }
503
+ def credit_transfers; end
504
+
505
+ sig { returns(T.nilable(Facturx::PaymentCard)) }
506
+ def payment_card; end
507
+
508
+ sig { returns(T.nilable(Facturx::DirectDebit)) }
509
+ def direct_debit; end
510
+
511
+ sig do
512
+ params(
513
+ means_code: T.nilable(String),
514
+ means_text: T.nilable(String),
515
+ remittance_information: T.nilable(String),
516
+ credit_transfers: T::Array[Facturx::CreditTransfer],
517
+ payment_card: T.nilable(Facturx::PaymentCard),
518
+ direct_debit: T.nilable(Facturx::DirectDebit)
519
+ ).returns(Facturx::PaymentInstructions)
520
+ end
521
+ def with(means_code: self.means_code, means_text: self.means_text,
522
+ remittance_information: self.remittance_information,
523
+ credit_transfers: self.credit_transfers, payment_card: self.payment_card,
524
+ direct_debit: self.direct_debit); end
525
+ end
526
+
527
+ class DocumentReference
528
+ sig do
529
+ params(
530
+ id: T.nilable(String),
531
+ line_id: T.nilable(String),
532
+ name: T.nilable(String),
533
+ issue_date: T.nilable(::Date)
534
+ ).void
535
+ end
536
+ def initialize(id: nil, line_id: nil, name: nil, issue_date: nil); end
537
+
538
+ sig { returns(T.nilable(String)) }
539
+ attr_reader :id, :line_id, :name
540
+
541
+ sig { returns(T.nilable(::Date)) }
542
+ attr_reader :issue_date
543
+
544
+ sig do
545
+ params(
546
+ id: T.nilable(String),
547
+ line_id: T.nilable(String),
548
+ name: T.nilable(String),
549
+ issue_date: T.nilable(::Date)
550
+ ).returns(Facturx::DocumentReference)
551
+ end
552
+ def with(id: self.id, line_id: self.line_id, name: self.name, issue_date: self.issue_date); end
553
+ end
554
+
555
+ class Delivery
556
+ sig do
557
+ params(
558
+ location_identifier: T.nilable(Facturx::Identifier),
559
+ party: T.nilable(Facturx::Party),
560
+ date: T.nilable(::Date)
561
+ ).void
562
+ end
563
+ def initialize(location_identifier: nil, party: nil, date: nil); end
564
+
565
+ sig { returns(T.nilable(::Date)) }
566
+ attr_reader :date
567
+
568
+ sig { returns(T.nilable(Facturx::Identifier)) }
569
+ def location_identifier; end
570
+
571
+ sig { returns(T.nilable(Facturx::Party)) }
572
+ def party; end
573
+
574
+ sig do
575
+ params(
576
+ location_identifier: T.nilable(Facturx::Identifier),
577
+ party: T.nilable(Facturx::Party),
578
+ date: T.nilable(::Date)
579
+ ).returns(Facturx::Delivery)
580
+ end
581
+ def with(location_identifier: self.location_identifier, party: self.party, date: self.date); end
582
+ end
583
+
584
+ class SupportingDocument
585
+ sig do
586
+ params(
587
+ reference: T.nilable(String),
588
+ description: T.nilable(String),
589
+ external_location: T.nilable(String),
590
+ content: T.nilable(String),
591
+ mime_code: T.nilable(String),
592
+ filename: T.nilable(String)
593
+ ).void
594
+ end
595
+ def initialize(reference: nil, description: nil, external_location: nil, content: nil,
596
+ mime_code: nil, filename: nil); end
597
+
598
+ sig { returns(T.nilable(String)) }
599
+ attr_reader :reference, :description, :external_location, :content, :mime_code, :filename
600
+
601
+ sig do
602
+ params(
603
+ reference: T.nilable(String),
604
+ description: T.nilable(String),
605
+ external_location: T.nilable(String),
606
+ content: T.nilable(String),
607
+ mime_code: T.nilable(String),
608
+ filename: T.nilable(String)
609
+ ).returns(Facturx::SupportingDocument)
610
+ end
611
+ def with(reference: self.reference, description: self.description,
612
+ external_location: self.external_location, content: self.content,
613
+ mime_code: self.mime_code, filename: self.filename); end
614
+ end
615
+
616
+ class ProductAttribute
617
+ sig { params(name: T.nilable(String), value: T.nilable(String)).void }
618
+ def initialize(name: nil, value: nil); end
619
+
620
+ sig { returns(T.nilable(String)) }
621
+ attr_reader :name, :value
622
+
623
+ sig { params(name: T.nilable(String), value: T.nilable(String)).returns(Facturx::ProductAttribute) }
624
+ def with(name: self.name, value: self.value); end
625
+ end
626
+
627
+ class ProductClassification
628
+ sig do
629
+ params(code: T.nilable(String), list_id: T.nilable(String), list_version_id: T.nilable(String)).void
630
+ end
631
+ def initialize(code: nil, list_id: nil, list_version_id: nil); end
632
+
633
+ sig { returns(T.nilable(String)) }
634
+ attr_reader :code, :list_id, :list_version_id
635
+
636
+ sig do
637
+ params(code: T.nilable(String), list_id: T.nilable(String), list_version_id: T.nilable(String))
638
+ .returns(Facturx::ProductClassification)
639
+ end
640
+ def with(code: self.code, list_id: self.list_id, list_version_id: self.list_version_id); end
641
+ end
642
+
643
+ class Product
644
+ sig do
645
+ params(
646
+ name: T.nilable(String),
647
+ description: T.nilable(String),
648
+ seller_identifier: T.nilable(Facturx::Identifier),
649
+ buyer_identifier: T.nilable(Facturx::Identifier),
650
+ global_identifier: T.nilable(Facturx::Identifier),
651
+ attributes: T::Array[Facturx::ProductAttribute],
652
+ classifications: T::Array[Facturx::ProductClassification],
653
+ origin_country_code: T.nilable(String)
654
+ ).void
655
+ end
656
+ def initialize(name: nil, description: nil, seller_identifier: nil, buyer_identifier: nil,
657
+ global_identifier: nil, attributes: [], classifications: [], origin_country_code: nil); end
658
+
659
+ sig { returns(T.nilable(String)) }
660
+ attr_reader :name, :description, :origin_country_code
661
+
662
+ sig { returns(T.nilable(Facturx::Identifier)) }
663
+ def seller_identifier; end
664
+
665
+ sig { returns(T.nilable(Facturx::Identifier)) }
666
+ def buyer_identifier; end
667
+
668
+ sig { returns(T.nilable(Facturx::Identifier)) }
669
+ def global_identifier; end
670
+
671
+ sig { returns(T::Array[Facturx::ProductAttribute]) }
672
+ def attributes; end
673
+
674
+ sig { returns(T::Array[Facturx::ProductClassification]) }
675
+ def classifications; end
676
+
677
+ sig do
678
+ params(
679
+ name: T.nilable(String),
680
+ description: T.nilable(String),
681
+ seller_identifier: T.nilable(Facturx::Identifier),
682
+ buyer_identifier: T.nilable(Facturx::Identifier),
683
+ global_identifier: T.nilable(Facturx::Identifier),
684
+ attributes: T::Array[Facturx::ProductAttribute],
685
+ classifications: T::Array[Facturx::ProductClassification],
686
+ origin_country_code: T.nilable(String)
687
+ ).returns(Facturx::Product)
688
+ end
689
+ def with(name: self.name, description: self.description,
690
+ seller_identifier: self.seller_identifier, buyer_identifier: self.buyer_identifier,
691
+ global_identifier: self.global_identifier, attributes: self.attributes,
692
+ classifications: self.classifications, origin_country_code: self.origin_country_code); end
693
+ end
694
+
695
+ class Price
696
+ sig do
697
+ params(
698
+ amount: T.nilable(T.any(::BigDecimal, Integer)),
699
+ basis_quantity: T.nilable(Facturx::Quantity),
700
+ discount: T.nilable(T.any(::BigDecimal, Integer))
701
+ ).void
702
+ end
703
+ def initialize(amount: nil, basis_quantity: nil, discount: nil); end
704
+
705
+ sig { returns(T.nilable(T.any(::BigDecimal, Integer))) }
706
+ attr_reader :amount, :discount
707
+
708
+ sig { returns(T.nilable(Facturx::Quantity)) }
709
+ def basis_quantity; end
710
+
711
+ sig do
712
+ params(
713
+ amount: T.nilable(T.any(::BigDecimal, Integer)),
714
+ basis_quantity: T.nilable(Facturx::Quantity),
715
+ discount: T.nilable(T.any(::BigDecimal, Integer))
716
+ ).returns(Facturx::Price)
717
+ end
718
+ def with(amount: self.amount, basis_quantity: self.basis_quantity, discount: self.discount); end
719
+ end
720
+
721
+ class TaxBreakdown
722
+ sig do
723
+ params(
724
+ type_code: T.nilable(String),
725
+ category_code: T.nilable(String),
726
+ rate: T.nilable(T.any(::BigDecimal, Integer)),
727
+ basis_amount: T.nilable(T.any(::BigDecimal, Integer)),
728
+ tax_amount: T.nilable(T.any(::BigDecimal, Integer)),
729
+ exemption_reason: T.nilable(String),
730
+ exemption_reason_code: T.nilable(String),
731
+ due_date_type_code: T.nilable(String)
732
+ ).void
733
+ end
734
+ def initialize(type_code: nil, category_code: nil, rate: nil, basis_amount: nil, tax_amount: nil,
735
+ exemption_reason: nil, exemption_reason_code: nil, due_date_type_code: nil); end
736
+
737
+ sig { returns(T.nilable(String)) }
738
+ attr_reader :type_code, :category_code, :exemption_reason, :exemption_reason_code, :due_date_type_code
739
+
740
+ sig { returns(T.nilable(T.any(::BigDecimal, Integer))) }
741
+ attr_reader :rate, :basis_amount, :tax_amount
742
+
743
+ sig do
744
+ params(
745
+ type_code: T.nilable(String),
746
+ category_code: T.nilable(String),
747
+ rate: T.nilable(T.any(::BigDecimal, Integer)),
748
+ basis_amount: T.nilable(T.any(::BigDecimal, Integer)),
749
+ tax_amount: T.nilable(T.any(::BigDecimal, Integer)),
750
+ exemption_reason: T.nilable(String),
751
+ exemption_reason_code: T.nilable(String),
752
+ due_date_type_code: T.nilable(String)
753
+ ).returns(Facturx::TaxBreakdown)
754
+ end
755
+ def with(type_code: self.type_code, category_code: self.category_code, rate: self.rate,
756
+ basis_amount: self.basis_amount, tax_amount: self.tax_amount,
757
+ exemption_reason: self.exemption_reason,
758
+ exemption_reason_code: self.exemption_reason_code,
759
+ due_date_type_code: self.due_date_type_code); end
760
+ end
761
+
762
+ class AllowanceCharge
763
+ sig do
764
+ params(
765
+ indicator: T.nilable(T::Boolean),
766
+ amount: T.nilable(T.any(::BigDecimal, Integer)),
767
+ base_amount: T.nilable(T.any(::BigDecimal, Integer)),
768
+ percentage: T.nilable(T.any(::BigDecimal, Integer)),
769
+ reason: T.nilable(String),
770
+ reason_code: T.nilable(String),
771
+ tax: T.nilable(Facturx::TaxBreakdown)
772
+ ).void
773
+ end
774
+ def initialize(indicator: nil, amount: nil, base_amount: nil, percentage: nil, reason: nil,
775
+ reason_code: nil, tax: nil); end
776
+
777
+ sig { returns(T.nilable(T::Boolean)) }
778
+ attr_reader :indicator
779
+
780
+ sig { returns(T.nilable(T.any(::BigDecimal, Integer))) }
781
+ attr_reader :amount, :base_amount, :percentage
782
+
783
+ sig { returns(T.nilable(String)) }
784
+ attr_reader :reason, :reason_code
785
+
786
+ sig { returns(T.nilable(Facturx::TaxBreakdown)) }
787
+ def tax; end
788
+
789
+ sig do
790
+ params(
791
+ indicator: T.nilable(T::Boolean),
792
+ amount: T.nilable(T.any(::BigDecimal, Integer)),
793
+ base_amount: T.nilable(T.any(::BigDecimal, Integer)),
794
+ percentage: T.nilable(T.any(::BigDecimal, Integer)),
795
+ reason: T.nilable(String),
796
+ reason_code: T.nilable(String),
797
+ tax: T.nilable(Facturx::TaxBreakdown)
798
+ ).returns(Facturx::AllowanceCharge)
799
+ end
800
+ def with(indicator: self.indicator, amount: self.amount, base_amount: self.base_amount,
801
+ percentage: self.percentage, reason: self.reason, reason_code: self.reason_code,
802
+ tax: self.tax); end
803
+ end
804
+
805
+ class Totals
806
+ sig do
807
+ params(
808
+ line_total: T.nilable(T.any(::BigDecimal, Integer)),
809
+ charge_total: T.nilable(T.any(::BigDecimal, Integer)),
810
+ allowance_total: T.nilable(T.any(::BigDecimal, Integer)),
811
+ tax_basis_total: T.nilable(T.any(::BigDecimal, Integer)),
812
+ tax_total: T.nilable(T.any(::BigDecimal, Integer)),
813
+ tax_total_in_tax_currency: T.nilable(T.any(::BigDecimal, Integer)),
814
+ grand_total: T.nilable(T.any(::BigDecimal, Integer)),
815
+ prepaid: T.nilable(T.any(::BigDecimal, Integer)),
816
+ rounding: T.nilable(T.any(::BigDecimal, Integer)),
817
+ due_payable: T.nilable(T.any(::BigDecimal, Integer))
818
+ ).void
819
+ end
820
+ def initialize(line_total: nil, charge_total: nil, allowance_total: nil, tax_basis_total: nil,
821
+ tax_total: nil, tax_total_in_tax_currency: nil, grand_total: nil, prepaid: nil,
822
+ rounding: nil, due_payable: nil); end
823
+
824
+ sig { returns(T.nilable(T.any(::BigDecimal, Integer))) }
825
+ attr_reader :line_total, :charge_total, :allowance_total, :tax_basis_total, :tax_total,
826
+ :tax_total_in_tax_currency, :grand_total, :prepaid, :rounding, :due_payable
827
+
828
+ sig do
829
+ params(
830
+ line_total: T.nilable(T.any(::BigDecimal, Integer)),
831
+ charge_total: T.nilable(T.any(::BigDecimal, Integer)),
832
+ allowance_total: T.nilable(T.any(::BigDecimal, Integer)),
833
+ tax_basis_total: T.nilable(T.any(::BigDecimal, Integer)),
834
+ tax_total: T.nilable(T.any(::BigDecimal, Integer)),
835
+ tax_total_in_tax_currency: T.nilable(T.any(::BigDecimal, Integer)),
836
+ grand_total: T.nilable(T.any(::BigDecimal, Integer)),
837
+ prepaid: T.nilable(T.any(::BigDecimal, Integer)),
838
+ rounding: T.nilable(T.any(::BigDecimal, Integer)),
839
+ due_payable: T.nilable(T.any(::BigDecimal, Integer))
840
+ ).returns(Facturx::Totals)
841
+ end
842
+ def with(line_total: self.line_total, charge_total: self.charge_total,
843
+ allowance_total: self.allowance_total, tax_basis_total: self.tax_basis_total,
844
+ tax_total: self.tax_total, tax_total_in_tax_currency: self.tax_total_in_tax_currency,
845
+ grand_total: self.grand_total, prepaid: self.prepaid, rounding: self.rounding,
846
+ due_payable: self.due_payable); end
847
+ end
848
+
849
+ class Line
850
+ sig do
851
+ params(
852
+ id: T.nilable(String),
853
+ note: T.nilable(String),
854
+ product: T.nilable(Facturx::Product),
855
+ quantity: T.nilable(Facturx::Quantity),
856
+ gross_price: T.nilable(Facturx::Price),
857
+ net_price: T.nilable(Facturx::Price),
858
+ tax: T.nilable(Facturx::TaxBreakdown),
859
+ period: T.nilable(Facturx::Period),
860
+ net_amount: T.nilable(T.any(::BigDecimal, Integer)),
861
+ allowances: T::Array[Facturx::AllowanceCharge],
862
+ charges: T::Array[Facturx::AllowanceCharge],
863
+ buyer_order_reference: T.nilable(Facturx::DocumentReference),
864
+ invoiced_object_identifier: T.nilable(Facturx::Identifier),
865
+ buyer_accounting_reference: T.nilable(String)
866
+ ).void
867
+ end
868
+ def initialize(id: nil, note: nil, product: nil, quantity: nil, gross_price: nil,
869
+ net_price: nil, tax: nil, period: nil, net_amount: nil, allowances: [], charges: [],
870
+ buyer_order_reference: nil, invoiced_object_identifier: nil,
871
+ buyer_accounting_reference: nil); end
872
+
873
+ sig { returns(T.nilable(String)) }
874
+ attr_reader :id, :note, :buyer_accounting_reference
875
+
876
+ sig { returns(T.nilable(T.any(::BigDecimal, Integer))) }
877
+ attr_reader :net_amount
878
+
879
+ sig { returns(T.nilable(Facturx::Product)) }
880
+ def product; end
881
+
882
+ sig { returns(T.nilable(Facturx::Quantity)) }
883
+ def quantity; end
884
+
885
+ sig { returns(T.nilable(Facturx::Price)) }
886
+ def gross_price; end
887
+
888
+ sig { returns(T.nilable(Facturx::Price)) }
889
+ def net_price; end
890
+
891
+ sig { returns(T.nilable(Facturx::TaxBreakdown)) }
892
+ def tax; end
893
+
894
+ sig { returns(T.nilable(Facturx::Period)) }
895
+ def period; end
896
+
897
+ sig { returns(T::Array[Facturx::AllowanceCharge]) }
898
+ def allowances; end
899
+
900
+ sig { returns(T::Array[Facturx::AllowanceCharge]) }
901
+ def charges; end
902
+
903
+ sig { returns(T.nilable(Facturx::DocumentReference)) }
904
+ def buyer_order_reference; end
905
+
906
+ sig { returns(T.nilable(Facturx::Identifier)) }
907
+ def invoiced_object_identifier; end
908
+
909
+ sig do
910
+ params(
911
+ id: T.nilable(String),
912
+ note: T.nilable(String),
913
+ product: T.nilable(Facturx::Product),
914
+ quantity: T.nilable(Facturx::Quantity),
915
+ gross_price: T.nilable(Facturx::Price),
916
+ net_price: T.nilable(Facturx::Price),
917
+ tax: T.nilable(Facturx::TaxBreakdown),
918
+ period: T.nilable(Facturx::Period),
919
+ net_amount: T.nilable(T.any(::BigDecimal, Integer)),
920
+ allowances: T::Array[Facturx::AllowanceCharge],
921
+ charges: T::Array[Facturx::AllowanceCharge],
922
+ buyer_order_reference: T.nilable(Facturx::DocumentReference),
923
+ invoiced_object_identifier: T.nilable(Facturx::Identifier),
924
+ buyer_accounting_reference: T.nilable(String)
925
+ ).returns(Facturx::Line)
926
+ end
927
+ def with(id: self.id, note: self.note, product: self.product, quantity: self.quantity,
928
+ gross_price: self.gross_price, net_price: self.net_price, tax: self.tax,
929
+ period: self.period, net_amount: self.net_amount, allowances: self.allowances,
930
+ charges: self.charges, buyer_order_reference: self.buyer_order_reference,
931
+ invoiced_object_identifier: self.invoiced_object_identifier,
932
+ buyer_accounting_reference: self.buyer_accounting_reference); end
933
+ end
934
+
935
+ class Document
936
+ sig do
937
+ params(
938
+ guideline_urn: T.nilable(String),
939
+ business_process: T.nilable(String),
940
+ invoice_number: T.nilable(String),
941
+ type_code: T.nilable(String),
942
+ issue_date: T.nilable(::Date),
943
+ notes: T::Array[Facturx::Note],
944
+ currency: T.nilable(String),
945
+ tax_currency: T.nilable(String),
946
+ vat_point_date: T.nilable(::Date),
947
+ vat_point_date_code: T.nilable(String),
948
+ buyer_reference: T.nilable(String),
949
+ project_reference: T.nilable(Facturx::DocumentReference),
950
+ contract_reference: T.nilable(Facturx::DocumentReference),
951
+ purchase_order_reference: T.nilable(Facturx::DocumentReference),
952
+ sales_order_reference: T.nilable(Facturx::DocumentReference),
953
+ receiving_advice_reference: T.nilable(Facturx::DocumentReference),
954
+ despatch_advice_reference: T.nilable(Facturx::DocumentReference),
955
+ tender_or_lot_reference: T.nilable(Facturx::DocumentReference),
956
+ invoiced_object_identifier: T.nilable(Facturx::Identifier),
957
+ seller: T.nilable(Facturx::Party),
958
+ buyer: T.nilable(Facturx::Party),
959
+ payee: T.nilable(Facturx::Party),
960
+ tax_representative: T.nilable(Facturx::Party),
961
+ delivery: T.nilable(Facturx::Delivery),
962
+ billing_period: T.nilable(Facturx::Period),
963
+ payment: T.nilable(Facturx::PaymentInstructions),
964
+ payment_terms: T.nilable(String),
965
+ payment_due_date: T.nilable(::Date),
966
+ lines: T::Array[Facturx::Line],
967
+ tax_breakdowns: T::Array[Facturx::TaxBreakdown],
968
+ allowances: T::Array[Facturx::AllowanceCharge],
969
+ charges: T::Array[Facturx::AllowanceCharge],
970
+ totals: T.nilable(Facturx::Totals),
971
+ preceding_invoices: T::Array[Facturx::DocumentReference],
972
+ supporting_documents: T::Array[Facturx::SupportingDocument],
973
+ buyer_accounting_reference: T.nilable(String)
974
+ ).void
975
+ end
976
+ def initialize(guideline_urn: nil, business_process: nil, invoice_number: nil, type_code: nil,
977
+ issue_date: nil, notes: [], currency: nil, tax_currency: nil,
978
+ vat_point_date: nil, vat_point_date_code: nil, buyer_reference: nil,
979
+ project_reference: nil, contract_reference: nil, purchase_order_reference: nil,
980
+ sales_order_reference: nil, receiving_advice_reference: nil,
981
+ despatch_advice_reference: nil, tender_or_lot_reference: nil,
982
+ invoiced_object_identifier: nil, seller: nil, buyer: nil, payee: nil,
983
+ tax_representative: nil, delivery: nil, billing_period: nil, payment: nil,
984
+ payment_terms: nil, payment_due_date: nil, lines: [], tax_breakdowns: [],
985
+ allowances: [], charges: [], totals: nil, preceding_invoices: [],
986
+ supporting_documents: [], buyer_accounting_reference: nil); end
987
+
988
+ sig { returns(T.nilable(String)) }
989
+ attr_reader :guideline_urn, :business_process, :invoice_number, :type_code, :currency, :tax_currency,
990
+ :vat_point_date_code, :buyer_reference, :buyer_accounting_reference, :payment_terms
991
+
992
+ sig { returns(T.nilable(::Date)) }
993
+ attr_reader :issue_date, :vat_point_date, :payment_due_date
994
+
995
+ sig do
996
+ params(
997
+ attributes: T.untyped,
998
+ block: T.nilable(T.proc.params(builder: Facturx::Builders::DocumentBuilder).void)
999
+ ).returns(Facturx::Document)
1000
+ end
1001
+ def self.build(**attributes, &block); end
1002
+
1003
+ sig { returns(T.nilable(Facturx::DocumentReference)) }
1004
+ def project_reference; end
1005
+
1006
+ sig { returns(T.nilable(Facturx::DocumentReference)) }
1007
+ def contract_reference; end
1008
+
1009
+ sig { returns(T.nilable(Facturx::DocumentReference)) }
1010
+ def purchase_order_reference; end
1011
+
1012
+ sig { returns(T.nilable(Facturx::DocumentReference)) }
1013
+ def sales_order_reference; end
1014
+
1015
+ sig { returns(T.nilable(Facturx::DocumentReference)) }
1016
+ def receiving_advice_reference; end
1017
+
1018
+ sig { returns(T.nilable(Facturx::DocumentReference)) }
1019
+ def despatch_advice_reference; end
1020
+
1021
+ sig { returns(T.nilable(Facturx::DocumentReference)) }
1022
+ def tender_or_lot_reference; end
1023
+
1024
+ sig { returns(T.nilable(Facturx::Identifier)) }
1025
+ def invoiced_object_identifier; end
1026
+
1027
+ sig { returns(T.nilable(Facturx::Party)) }
1028
+ def seller; end
1029
+
1030
+ sig { returns(T.nilable(Facturx::Party)) }
1031
+ def buyer; end
1032
+
1033
+ sig { returns(T.nilable(Facturx::Party)) }
1034
+ def payee; end
1035
+
1036
+ sig { returns(T.nilable(Facturx::Party)) }
1037
+ def tax_representative; end
1038
+
1039
+ sig { returns(T.nilable(Facturx::Delivery)) }
1040
+ def delivery; end
1041
+
1042
+ sig { returns(T.nilable(Facturx::Period)) }
1043
+ def billing_period; end
1044
+
1045
+ sig { returns(T.nilable(Facturx::PaymentInstructions)) }
1046
+ def payment; end
1047
+
1048
+ sig { returns(T::Array[Facturx::Note]) }
1049
+ def notes; end
1050
+
1051
+ sig { returns(T::Array[Facturx::Line]) }
1052
+ def lines; end
1053
+
1054
+ sig { returns(T::Array[Facturx::TaxBreakdown]) }
1055
+ def tax_breakdowns; end
1056
+
1057
+ sig { returns(T::Array[Facturx::AllowanceCharge]) }
1058
+ def allowances; end
1059
+
1060
+ sig { returns(T::Array[Facturx::AllowanceCharge]) }
1061
+ def charges; end
1062
+
1063
+ sig { returns(T.nilable(Facturx::Totals)) }
1064
+ def totals; end
1065
+
1066
+ sig { returns(T::Array[Facturx::DocumentReference]) }
1067
+ def preceding_invoices; end
1068
+
1069
+ sig { returns(T::Array[Facturx::SupportingDocument]) }
1070
+ def supporting_documents; end
1071
+
1072
+ sig do
1073
+ params(
1074
+ guideline_urn: T.nilable(String),
1075
+ business_process: T.nilable(String),
1076
+ invoice_number: T.nilable(String),
1077
+ type_code: T.nilable(String),
1078
+ issue_date: T.nilable(::Date),
1079
+ notes: T::Array[Facturx::Note],
1080
+ currency: T.nilable(String),
1081
+ tax_currency: T.nilable(String),
1082
+ vat_point_date: T.nilable(::Date),
1083
+ vat_point_date_code: T.nilable(String),
1084
+ buyer_reference: T.nilable(String),
1085
+ project_reference: T.nilable(Facturx::DocumentReference),
1086
+ contract_reference: T.nilable(Facturx::DocumentReference),
1087
+ purchase_order_reference: T.nilable(Facturx::DocumentReference),
1088
+ sales_order_reference: T.nilable(Facturx::DocumentReference),
1089
+ receiving_advice_reference: T.nilable(Facturx::DocumentReference),
1090
+ despatch_advice_reference: T.nilable(Facturx::DocumentReference),
1091
+ tender_or_lot_reference: T.nilable(Facturx::DocumentReference),
1092
+ invoiced_object_identifier: T.nilable(Facturx::Identifier),
1093
+ seller: T.nilable(Facturx::Party),
1094
+ buyer: T.nilable(Facturx::Party),
1095
+ payee: T.nilable(Facturx::Party),
1096
+ tax_representative: T.nilable(Facturx::Party),
1097
+ delivery: T.nilable(Facturx::Delivery),
1098
+ billing_period: T.nilable(Facturx::Period),
1099
+ payment: T.nilable(Facturx::PaymentInstructions),
1100
+ payment_terms: T.nilable(String),
1101
+ payment_due_date: T.nilable(::Date),
1102
+ lines: T::Array[Facturx::Line],
1103
+ tax_breakdowns: T::Array[Facturx::TaxBreakdown],
1104
+ allowances: T::Array[Facturx::AllowanceCharge],
1105
+ charges: T::Array[Facturx::AllowanceCharge],
1106
+ totals: T.nilable(Facturx::Totals),
1107
+ preceding_invoices: T::Array[Facturx::DocumentReference],
1108
+ supporting_documents: T::Array[Facturx::SupportingDocument],
1109
+ buyer_accounting_reference: T.nilable(String)
1110
+ ).returns(Facturx::Document)
1111
+ end
1112
+ def with(guideline_urn: self.guideline_urn, business_process: self.business_process,
1113
+ invoice_number: self.invoice_number, type_code: self.type_code, issue_date: self.issue_date,
1114
+ notes: self.notes, currency: self.currency, tax_currency: self.tax_currency,
1115
+ vat_point_date: self.vat_point_date, vat_point_date_code: self.vat_point_date_code,
1116
+ buyer_reference: self.buyer_reference, project_reference: self.project_reference,
1117
+ contract_reference: self.contract_reference,
1118
+ purchase_order_reference: self.purchase_order_reference,
1119
+ sales_order_reference: self.sales_order_reference,
1120
+ receiving_advice_reference: self.receiving_advice_reference,
1121
+ despatch_advice_reference: self.despatch_advice_reference,
1122
+ tender_or_lot_reference: self.tender_or_lot_reference,
1123
+ invoiced_object_identifier: self.invoiced_object_identifier, seller: self.seller,
1124
+ buyer: self.buyer, payee: self.payee, tax_representative: self.tax_representative,
1125
+ delivery: self.delivery, billing_period: self.billing_period, payment: self.payment,
1126
+ payment_terms: self.payment_terms, payment_due_date: self.payment_due_date,
1127
+ lines: self.lines, tax_breakdowns: self.tax_breakdowns, allowances: self.allowances,
1128
+ charges: self.charges, totals: self.totals, preceding_invoices: self.preceding_invoices,
1129
+ supporting_documents: self.supporting_documents,
1130
+ buyer_accounting_reference: self.buyer_accounting_reference); end
1131
+ end
1132
+
1133
+ module Builders
1134
+ class Base
1135
+ sig { params(attributes: T.untyped).void }
1136
+ def initialize(**attributes); end
1137
+
1138
+ sig { returns(T.untyped) }
1139
+ def build; end
1140
+ end
1141
+
1142
+ class NoteBuilder < Base
1143
+ sig { returns(T.nilable(String)) }
1144
+ attr_accessor :content, :subject_code
1145
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: NoteBuilder).void)).returns(Note) }
1146
+ def self.build(**attributes, &block); end
1147
+ sig { returns(Note) }
1148
+ def build; end
1149
+ end
1150
+
1151
+ class IdentifierBuilder < Base
1152
+ sig { returns(T.nilable(String)) }
1153
+ attr_accessor :value, :scheme_id
1154
+ sig do
1155
+ params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: IdentifierBuilder).void))
1156
+ .returns(Identifier)
1157
+ end
1158
+ def self.build(**attributes, &block); end
1159
+ sig { returns(Identifier) }
1160
+ def build; end
1161
+ end
1162
+
1163
+ class PeriodBuilder < Base
1164
+ sig { returns(T.nilable(::Date)) }
1165
+ attr_accessor :start_date, :end_date
1166
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: PeriodBuilder).void)).returns(Period) }
1167
+ def self.build(**attributes, &block); end
1168
+ sig { returns(Period) }
1169
+ def build; end
1170
+ end
1171
+
1172
+ class QuantityBuilder < Base
1173
+ sig { returns(T.nilable(T.any(::BigDecimal, Integer))) }
1174
+ attr_accessor :value
1175
+
1176
+ sig { returns(T.nilable(String)) }
1177
+ attr_accessor :unit_code
1178
+ sig do
1179
+ params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: QuantityBuilder).void))
1180
+ .returns(Quantity)
1181
+ end
1182
+ def self.build(**attributes, &block); end
1183
+ sig { returns(Quantity) }
1184
+ def build; end
1185
+ end
1186
+
1187
+ class ContactBuilder < Base
1188
+ sig { returns(T.nilable(String)) }
1189
+ attr_accessor :name, :telephone, :email
1190
+ sig do
1191
+ params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: ContactBuilder).void))
1192
+ .returns(Contact)
1193
+ end
1194
+ def self.build(**attributes, &block); end
1195
+ sig { returns(Contact) }
1196
+ def build; end
1197
+ end
1198
+
1199
+ class AddressBuilder < Base
1200
+ sig { returns(T.nilable(String)) }
1201
+ attr_accessor :postcode, :line_one, :line_two, :line_three, :city, :country_code, :country_subdivision
1202
+ sig do
1203
+ params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: AddressBuilder).void))
1204
+ .returns(Address)
1205
+ end
1206
+ def self.build(**attributes, &block); end
1207
+ sig { returns(Address) }
1208
+ def build; end
1209
+ end
1210
+
1211
+ class PartyBuilder < Base
1212
+ sig { returns(T.nilable(String)) }
1213
+ attr_accessor :name, :description, :trading_name
1214
+
1215
+ sig { params(identifiers: T::Array[Identifier]).returns(T::Array[Identifier]) }
1216
+ attr_writer :identifiers
1217
+
1218
+ sig { returns(T::Array[Identifier]) }
1219
+ attr_reader :identifiers
1220
+
1221
+ sig { params(value: Identifier, attributes: T.untyped, block: T.nilable(T.proc.params(builder: IdentifierBuilder).void)).returns(Identifier) }
1222
+ def identifier(value = T.unsafe(nil), **attributes, &block); end
1223
+
1224
+ sig { params(legal_registration: T.nilable(Identifier)).returns(T.nilable(Identifier)) }
1225
+ attr_writer :legal_registration
1226
+
1227
+ sig { params(vat_identifier: T.nilable(Identifier)).returns(T.nilable(Identifier)) }
1228
+ attr_writer :vat_identifier
1229
+
1230
+ sig { params(tax_identifier: T.nilable(Identifier)).returns(T.nilable(Identifier)) }
1231
+ attr_writer :tax_identifier
1232
+
1233
+ sig { params(electronic_address: T.nilable(Identifier)).returns(T.nilable(Identifier)) }
1234
+ attr_writer :electronic_address
1235
+
1236
+ sig { params(address: T.nilable(Address)).returns(T.nilable(Address)) }
1237
+ attr_writer :address
1238
+
1239
+ sig { params(contact: T.nilable(Contact)).returns(T.nilable(Contact)) }
1240
+ attr_writer :contact
1241
+
1242
+ sig { params(value: Identifier, attributes: T.untyped, block: T.nilable(T.proc.params(builder: IdentifierBuilder).void)).returns(Identifier) }
1243
+ def legal_registration(value = T.unsafe(nil), **attributes, &block); end
1244
+ sig { params(value: Address, attributes: T.untyped, block: T.nilable(T.proc.params(builder: AddressBuilder).void)).returns(Address) }
1245
+ def address(value = T.unsafe(nil), **attributes, &block); end
1246
+ sig { params(value: Identifier, attributes: T.untyped, block: T.nilable(T.proc.params(builder: IdentifierBuilder).void)).returns(Identifier) }
1247
+ def vat_identifier(value = T.unsafe(nil), **attributes, &block); end
1248
+ sig { params(value: Identifier, attributes: T.untyped, block: T.nilable(T.proc.params(builder: IdentifierBuilder).void)).returns(Identifier) }
1249
+ def tax_identifier(value = T.unsafe(nil), **attributes, &block); end
1250
+ sig { params(value: Identifier, attributes: T.untyped, block: T.nilable(T.proc.params(builder: IdentifierBuilder).void)).returns(Identifier) }
1251
+ def electronic_address(value = T.unsafe(nil), **attributes, &block); end
1252
+ sig { params(value: Contact, attributes: T.untyped, block: T.nilable(T.proc.params(builder: ContactBuilder).void)).returns(Contact) }
1253
+ def contact(value = T.unsafe(nil), **attributes, &block); end
1254
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: PartyBuilder).void)).returns(Party) }
1255
+ def self.build(**attributes, &block); end
1256
+ sig { returns(Party) }
1257
+ def build; end
1258
+ end
1259
+
1260
+ class CreditTransferBuilder < Base
1261
+ sig { returns(T.nilable(String)) }
1262
+ attr_accessor :account_name
1263
+
1264
+ sig { params(account_identifier: T.nilable(Identifier)).returns(T.nilable(Identifier)) }
1265
+ attr_writer :account_identifier
1266
+
1267
+ sig { params(provider_identifier: T.nilable(Identifier)).returns(T.nilable(Identifier)) }
1268
+ attr_writer :provider_identifier
1269
+
1270
+ sig { params(value: Identifier, attributes: T.untyped, block: T.nilable(T.proc.params(builder: IdentifierBuilder).void)).returns(Identifier) }
1271
+ def account_identifier(value = T.unsafe(nil), **attributes, &block); end
1272
+ sig { params(value: Identifier, attributes: T.untyped, block: T.nilable(T.proc.params(builder: IdentifierBuilder).void)).returns(Identifier) }
1273
+ def provider_identifier(value = T.unsafe(nil), **attributes, &block); end
1274
+ sig do
1275
+ params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: CreditTransferBuilder).void))
1276
+ .returns(CreditTransfer)
1277
+ end
1278
+ def self.build(**attributes, &block); end
1279
+ sig { returns(CreditTransfer) }
1280
+ def build; end
1281
+ end
1282
+
1283
+ class PaymentCardBuilder < Base
1284
+ sig { returns(T.nilable(String)) }
1285
+ attr_accessor :primary_account_number, :holder_name
1286
+ sig do
1287
+ params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: PaymentCardBuilder).void))
1288
+ .returns(PaymentCard)
1289
+ end
1290
+ def self.build(**attributes, &block); end
1291
+ sig { returns(PaymentCard) }
1292
+ def build; end
1293
+ end
1294
+
1295
+ class DirectDebitBuilder < Base
1296
+ sig { params(mandate_identifier: T.nilable(Identifier)).returns(T.nilable(Identifier)) }
1297
+ attr_writer :mandate_identifier
1298
+
1299
+ sig { params(creditor_identifier: T.nilable(Identifier)).returns(T.nilable(Identifier)) }
1300
+ attr_writer :creditor_identifier
1301
+
1302
+ sig { params(debtor_account_identifier: T.nilable(Identifier)).returns(T.nilable(Identifier)) }
1303
+ attr_writer :debtor_account_identifier
1304
+
1305
+ sig { params(value: Identifier, attributes: T.untyped, block: T.nilable(T.proc.params(builder: IdentifierBuilder).void)).returns(Identifier) }
1306
+ def mandate_identifier(value = T.unsafe(nil), **attributes, &block); end
1307
+ sig { params(value: Identifier, attributes: T.untyped, block: T.nilable(T.proc.params(builder: IdentifierBuilder).void)).returns(Identifier) }
1308
+ def creditor_identifier(value = T.unsafe(nil), **attributes, &block); end
1309
+ sig { params(value: Identifier, attributes: T.untyped, block: T.nilable(T.proc.params(builder: IdentifierBuilder).void)).returns(Identifier) }
1310
+ def debtor_account_identifier(value = T.unsafe(nil), **attributes, &block); end
1311
+ sig do
1312
+ params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: DirectDebitBuilder).void))
1313
+ .returns(DirectDebit)
1314
+ end
1315
+ def self.build(**attributes, &block); end
1316
+ sig { returns(DirectDebit) }
1317
+ def build; end
1318
+ end
1319
+
1320
+ class PaymentInstructionsBuilder < Base
1321
+ sig { returns(T.nilable(String)) }
1322
+ attr_accessor :means_code, :means_text, :remittance_information
1323
+
1324
+ sig { params(credit_transfers: T::Array[CreditTransfer]).returns(T::Array[CreditTransfer]) }
1325
+ attr_writer :credit_transfers
1326
+
1327
+ sig { returns(T::Array[CreditTransfer]) }
1328
+ attr_reader :credit_transfers
1329
+
1330
+ sig { params(value: CreditTransfer, attributes: T.untyped, block: T.nilable(T.proc.params(builder: CreditTransferBuilder).void)).returns(CreditTransfer) }
1331
+ def credit_transfer(value = T.unsafe(nil), **attributes, &block); end
1332
+
1333
+ sig { params(payment_card: T.nilable(PaymentCard)).returns(T.nilable(PaymentCard)) }
1334
+ attr_writer :payment_card
1335
+
1336
+ sig { params(direct_debit: T.nilable(DirectDebit)).returns(T.nilable(DirectDebit)) }
1337
+ attr_writer :direct_debit
1338
+
1339
+ sig { params(value: PaymentCard, attributes: T.untyped, block: T.nilable(T.proc.params(builder: PaymentCardBuilder).void)).returns(PaymentCard) }
1340
+ def payment_card(value = T.unsafe(nil), **attributes, &block); end
1341
+ sig { params(value: DirectDebit, attributes: T.untyped, block: T.nilable(T.proc.params(builder: DirectDebitBuilder).void)).returns(DirectDebit) }
1342
+ def direct_debit(value = T.unsafe(nil), **attributes, &block); end
1343
+ sig do
1344
+ params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: PaymentInstructionsBuilder).void))
1345
+ .returns(PaymentInstructions)
1346
+ end
1347
+ def self.build(**attributes, &block); end
1348
+ sig { returns(PaymentInstructions) }
1349
+ def build; end
1350
+ end
1351
+
1352
+ class DocumentReferenceBuilder < Base
1353
+ sig { returns(T.nilable(String)) }
1354
+ attr_accessor :id, :line_id, :name
1355
+
1356
+ sig { returns(T.nilable(::Date)) }
1357
+ attr_accessor :issue_date
1358
+ sig do
1359
+ params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: DocumentReferenceBuilder).void))
1360
+ .returns(DocumentReference)
1361
+ end
1362
+ def self.build(**attributes, &block); end
1363
+ sig { returns(DocumentReference) }
1364
+ def build; end
1365
+ end
1366
+
1367
+ class DeliveryBuilder < Base
1368
+ sig { returns(T.nilable(::Date)) }
1369
+ attr_accessor :date
1370
+
1371
+ sig { params(location_identifier: T.nilable(Identifier)).returns(T.nilable(Identifier)) }
1372
+ attr_writer :location_identifier
1373
+
1374
+ sig { params(party: T.nilable(Party)).returns(T.nilable(Party)) }
1375
+ attr_writer :party
1376
+
1377
+ sig { params(value: Identifier, attributes: T.untyped, block: T.nilable(T.proc.params(builder: IdentifierBuilder).void)).returns(Identifier) }
1378
+ def location_identifier(value = T.unsafe(nil), **attributes, &block); end
1379
+ sig { params(value: Party, attributes: T.untyped, block: T.nilable(T.proc.params(builder: PartyBuilder).void)).returns(Party) }
1380
+ def party(value = T.unsafe(nil), **attributes, &block); end
1381
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: DeliveryBuilder).void)).returns(Delivery) }
1382
+ def self.build(**attributes, &block); end
1383
+ sig { returns(Delivery) }
1384
+ def build; end
1385
+ end
1386
+
1387
+ class SupportingDocumentBuilder < Base
1388
+ sig { returns(T.nilable(String)) }
1389
+ attr_accessor :reference, :description, :external_location, :content, :mime_code, :filename
1390
+ sig do
1391
+ params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: SupportingDocumentBuilder).void))
1392
+ .returns(SupportingDocument)
1393
+ end
1394
+ def self.build(**attributes, &block); end
1395
+ sig { returns(SupportingDocument) }
1396
+ def build; end
1397
+ end
1398
+
1399
+ class ProductAttributeBuilder < Base
1400
+ sig { returns(T.nilable(String)) }
1401
+ attr_accessor :name, :value
1402
+ sig do
1403
+ params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: ProductAttributeBuilder).void))
1404
+ .returns(ProductAttribute)
1405
+ end
1406
+ def self.build(**attributes, &block); end
1407
+ sig { returns(ProductAttribute) }
1408
+ def build; end
1409
+ end
1410
+
1411
+ class ProductClassificationBuilder < Base
1412
+ sig { returns(T.nilable(String)) }
1413
+ attr_accessor :code, :list_id, :list_version_id
1414
+ sig do
1415
+ params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: ProductClassificationBuilder).void))
1416
+ .returns(ProductClassification)
1417
+ end
1418
+ def self.build(**attributes, &block); end
1419
+ sig { returns(ProductClassification) }
1420
+ def build; end
1421
+ end
1422
+
1423
+ class ProductBuilder < Base
1424
+ sig { returns(T.nilable(String)) }
1425
+ attr_accessor :name, :description, :origin_country_code
1426
+
1427
+ sig { params(seller_identifier: T.nilable(Identifier)).returns(T.nilable(Identifier)) }
1428
+ attr_writer :seller_identifier
1429
+
1430
+ sig { params(buyer_identifier: T.nilable(Identifier)).returns(T.nilable(Identifier)) }
1431
+ attr_writer :buyer_identifier
1432
+
1433
+ sig { params(global_identifier: T.nilable(Identifier)).returns(T.nilable(Identifier)) }
1434
+ attr_writer :global_identifier
1435
+
1436
+ sig { params(attributes: T::Array[ProductAttribute]).returns(T::Array[ProductAttribute]) }
1437
+ attr_writer :attributes
1438
+
1439
+ sig { returns(T::Array[ProductAttribute]) }
1440
+ attr_reader :attributes
1441
+
1442
+ sig { params(classifications: T::Array[ProductClassification]).returns(T::Array[ProductClassification]) }
1443
+ attr_writer :classifications
1444
+
1445
+ sig { returns(T::Array[ProductClassification]) }
1446
+ attr_reader :classifications
1447
+
1448
+ sig { params(value: Identifier, attributes: T.untyped, block: T.nilable(T.proc.params(builder: IdentifierBuilder).void)).returns(Identifier) }
1449
+ def seller_identifier(value = T.unsafe(nil), **attributes, &block); end
1450
+ sig { params(value: Identifier, attributes: T.untyped, block: T.nilable(T.proc.params(builder: IdentifierBuilder).void)).returns(Identifier) }
1451
+ def buyer_identifier(value = T.unsafe(nil), **attributes, &block); end
1452
+ sig { params(value: Identifier, attributes: T.untyped, block: T.nilable(T.proc.params(builder: IdentifierBuilder).void)).returns(Identifier) }
1453
+ def global_identifier(value = T.unsafe(nil), **attributes, &block); end
1454
+ sig { params(value: ProductAttribute, attributes: T.untyped, block: T.nilable(T.proc.params(builder: ProductAttributeBuilder).void)).returns(ProductAttribute) }
1455
+ def attribute(value = T.unsafe(nil), **attributes, &block); end
1456
+ sig { params(value: ProductClassification, attributes: T.untyped, block: T.nilable(T.proc.params(builder: ProductClassificationBuilder).void)).returns(ProductClassification) }
1457
+ def classification(value = T.unsafe(nil), **attributes, &block); end
1458
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: ProductBuilder).void)).returns(Product) }
1459
+ def self.build(**attributes, &block); end
1460
+ sig { returns(Product) }
1461
+ def build; end
1462
+ end
1463
+
1464
+ class PriceBuilder < Base
1465
+ sig { returns(T.nilable(T.any(::BigDecimal, Integer))) }
1466
+ attr_accessor :amount, :discount
1467
+
1468
+ sig { params(basis_quantity: T.nilable(Quantity)).returns(T.nilable(Quantity)) }
1469
+ attr_writer :basis_quantity
1470
+
1471
+ sig { params(value: Quantity, attributes: T.untyped, block: T.nilable(T.proc.params(builder: QuantityBuilder).void)).returns(Quantity) }
1472
+ def basis_quantity(value = T.unsafe(nil), **attributes, &block); end
1473
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: PriceBuilder).void)).returns(Price) }
1474
+ def self.build(**attributes, &block); end
1475
+ sig { returns(Price) }
1476
+ def build; end
1477
+ end
1478
+
1479
+ class TaxBreakdownBuilder < Base
1480
+ sig { returns(T.nilable(String)) }
1481
+ attr_accessor :type_code, :category_code, :exemption_reason, :exemption_reason_code, :due_date_type_code
1482
+
1483
+ sig { returns(T.nilable(T.any(::BigDecimal, Integer))) }
1484
+ attr_accessor :rate, :basis_amount, :tax_amount
1485
+ sig do
1486
+ params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: TaxBreakdownBuilder).void))
1487
+ .returns(TaxBreakdown)
1488
+ end
1489
+ def self.build(**attributes, &block); end
1490
+ sig { returns(TaxBreakdown) }
1491
+ def build; end
1492
+ end
1493
+
1494
+ class AllowanceChargeBuilder < Base
1495
+ sig { returns(T.nilable(T::Boolean)) }
1496
+ attr_accessor :indicator
1497
+
1498
+ sig { returns(T.nilable(T.any(::BigDecimal, Integer))) }
1499
+ attr_accessor :amount, :base_amount, :percentage
1500
+
1501
+ sig { returns(T.nilable(String)) }
1502
+ attr_accessor :reason, :reason_code
1503
+
1504
+ sig { params(tax: T.nilable(TaxBreakdown)).returns(T.nilable(TaxBreakdown)) }
1505
+ attr_writer :tax
1506
+
1507
+ sig { params(value: TaxBreakdown, attributes: T.untyped, block: T.nilable(T.proc.params(builder: TaxBreakdownBuilder).void)).returns(TaxBreakdown) }
1508
+ def tax(value = T.unsafe(nil), **attributes, &block); end
1509
+ sig do
1510
+ params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: AllowanceChargeBuilder).void))
1511
+ .returns(AllowanceCharge)
1512
+ end
1513
+ def self.build(**attributes, &block); end
1514
+ sig { returns(AllowanceCharge) }
1515
+ def build; end
1516
+ end
1517
+
1518
+ class TotalsBuilder < Base
1519
+ sig { returns(T.nilable(T.any(::BigDecimal, Integer))) }
1520
+ attr_accessor :line_total, :charge_total, :allowance_total, :tax_basis_total, :tax_total,
1521
+ :tax_total_in_tax_currency, :grand_total, :prepaid, :rounding, :due_payable
1522
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: TotalsBuilder).void)).returns(Totals) }
1523
+ def self.build(**attributes, &block); end
1524
+ sig { returns(Totals) }
1525
+ def build; end
1526
+ end
1527
+
1528
+ class LineBuilder < Base
1529
+ sig { returns(T.nilable(String)) }
1530
+ attr_accessor :id, :note, :buyer_accounting_reference
1531
+
1532
+ sig { returns(T.nilable(T.any(::BigDecimal, Integer))) }
1533
+ attr_accessor :net_amount
1534
+
1535
+ sig { params(product: T.nilable(Product)).returns(T.nilable(Product)) }
1536
+ attr_writer :product
1537
+
1538
+ sig { params(quantity: T.nilable(Quantity)).returns(T.nilable(Quantity)) }
1539
+ attr_writer :quantity
1540
+
1541
+ sig { params(gross_price: T.nilable(Price)).returns(T.nilable(Price)) }
1542
+ attr_writer :gross_price
1543
+
1544
+ sig { params(net_price: T.nilable(Price)).returns(T.nilable(Price)) }
1545
+ attr_writer :net_price
1546
+
1547
+ sig { params(tax: T.nilable(TaxBreakdown)).returns(T.nilable(TaxBreakdown)) }
1548
+ attr_writer :tax
1549
+
1550
+ sig { params(period: T.nilable(Period)).returns(T.nilable(Period)) }
1551
+ attr_writer :period
1552
+
1553
+ sig { params(allowances: T::Array[AllowanceCharge]).returns(T::Array[AllowanceCharge]) }
1554
+ attr_writer :allowances
1555
+
1556
+ sig { params(charges: T::Array[AllowanceCharge]).returns(T::Array[AllowanceCharge]) }
1557
+ attr_writer :charges
1558
+
1559
+ sig { returns(T::Array[AllowanceCharge]) }
1560
+ attr_reader :allowances, :charges
1561
+
1562
+ sig { params(buyer_order_reference: T.nilable(DocumentReference)).returns(T.nilable(DocumentReference)) }
1563
+ attr_writer :buyer_order_reference
1564
+
1565
+ sig { params(invoiced_object_identifier: T.nilable(Identifier)).returns(T.nilable(Identifier)) }
1566
+ attr_writer :invoiced_object_identifier
1567
+
1568
+ sig { params(value: Product, attributes: T.untyped, block: T.nilable(T.proc.params(builder: ProductBuilder).void)).returns(Product) }
1569
+ def product(value = T.unsafe(nil), **attributes, &block); end
1570
+ sig { params(value: Quantity, attributes: T.untyped, block: T.nilable(T.proc.params(builder: QuantityBuilder).void)).returns(Quantity) }
1571
+ def quantity(value = T.unsafe(nil), **attributes, &block); end
1572
+ sig { params(value: Price, attributes: T.untyped, block: T.nilable(T.proc.params(builder: PriceBuilder).void)).returns(Price) }
1573
+ def gross_price(value = T.unsafe(nil), **attributes, &block); end
1574
+ sig { params(value: Price, attributes: T.untyped, block: T.nilable(T.proc.params(builder: PriceBuilder).void)).returns(Price) }
1575
+ def net_price(value = T.unsafe(nil), **attributes, &block); end
1576
+ sig { params(value: TaxBreakdown, attributes: T.untyped, block: T.nilable(T.proc.params(builder: TaxBreakdownBuilder).void)).returns(TaxBreakdown) }
1577
+ def tax(value = T.unsafe(nil), **attributes, &block); end
1578
+ sig { params(value: Period, attributes: T.untyped, block: T.nilable(T.proc.params(builder: PeriodBuilder).void)).returns(Period) }
1579
+ def period(value = T.unsafe(nil), **attributes, &block); end
1580
+ sig { params(value: AllowanceCharge, attributes: T.untyped, block: T.nilable(T.proc.params(builder: AllowanceChargeBuilder).void)).returns(AllowanceCharge) }
1581
+ def allowance(value = T.unsafe(nil), **attributes, &block); end
1582
+ sig { params(value: AllowanceCharge, attributes: T.untyped, block: T.nilable(T.proc.params(builder: AllowanceChargeBuilder).void)).returns(AllowanceCharge) }
1583
+ def charge(value = T.unsafe(nil), **attributes, &block); end
1584
+ sig { params(value: DocumentReference, attributes: T.untyped, block: T.nilable(T.proc.params(builder: DocumentReferenceBuilder).void)).returns(DocumentReference) }
1585
+ def buyer_order_reference(value = T.unsafe(nil), **attributes, &block); end
1586
+ sig { params(value: Identifier, attributes: T.untyped, block: T.nilable(T.proc.params(builder: IdentifierBuilder).void)).returns(Identifier) }
1587
+ def invoiced_object_identifier(value = T.unsafe(nil), **attributes, &block); end
1588
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: LineBuilder).void)).returns(Line) }
1589
+ def self.build(**attributes, &block); end
1590
+ sig { returns(Line) }
1591
+ def build; end
1592
+ end
1593
+
1594
+ class DocumentBuilder < Base
1595
+ sig { returns(T.nilable(String)) }
1596
+ attr_accessor :guideline_urn, :business_process, :invoice_number, :type_code, :currency, :tax_currency,
1597
+ :vat_point_date_code, :buyer_reference, :buyer_accounting_reference, :payment_terms
1598
+
1599
+ sig { returns(T.nilable(::Date)) }
1600
+ attr_accessor :issue_date, :vat_point_date, :payment_due_date
1601
+
1602
+ sig { params(project_reference: T.nilable(DocumentReference)).returns(T.nilable(DocumentReference)) }
1603
+ attr_writer :project_reference
1604
+
1605
+ sig { params(contract_reference: T.nilable(DocumentReference)).returns(T.nilable(DocumentReference)) }
1606
+ attr_writer :contract_reference
1607
+
1608
+ sig do
1609
+ params(purchase_order_reference: T.nilable(DocumentReference)).returns(T.nilable(DocumentReference))
1610
+ end
1611
+ attr_writer :purchase_order_reference
1612
+
1613
+ sig { params(sales_order_reference: T.nilable(DocumentReference)).returns(T.nilable(DocumentReference)) }
1614
+ attr_writer :sales_order_reference
1615
+
1616
+ sig do
1617
+ params(receiving_advice_reference: T.nilable(DocumentReference)).returns(T.nilable(DocumentReference))
1618
+ end
1619
+ attr_writer :receiving_advice_reference
1620
+
1621
+ sig do
1622
+ params(despatch_advice_reference: T.nilable(DocumentReference)).returns(T.nilable(DocumentReference))
1623
+ end
1624
+ attr_writer :despatch_advice_reference
1625
+
1626
+ sig do
1627
+ params(tender_or_lot_reference: T.nilable(DocumentReference)).returns(T.nilable(DocumentReference))
1628
+ end
1629
+ attr_writer :tender_or_lot_reference
1630
+
1631
+ sig { params(invoiced_object_identifier: T.nilable(Identifier)).returns(T.nilable(Identifier)) }
1632
+ attr_writer :invoiced_object_identifier
1633
+
1634
+ sig { params(seller: T.nilable(Party)).returns(T.nilable(Party)) }
1635
+ attr_writer :seller
1636
+
1637
+ sig { params(buyer: T.nilable(Party)).returns(T.nilable(Party)) }
1638
+ attr_writer :buyer
1639
+
1640
+ sig { params(payee: T.nilable(Party)).returns(T.nilable(Party)) }
1641
+ attr_writer :payee
1642
+
1643
+ sig { params(tax_representative: T.nilable(Party)).returns(T.nilable(Party)) }
1644
+ attr_writer :tax_representative
1645
+
1646
+ sig { params(delivery: T.nilable(Delivery)).returns(T.nilable(Delivery)) }
1647
+ attr_writer :delivery
1648
+
1649
+ sig { params(billing_period: T.nilable(Period)).returns(T.nilable(Period)) }
1650
+ attr_writer :billing_period
1651
+
1652
+ sig { params(payment: T.nilable(PaymentInstructions)).returns(T.nilable(PaymentInstructions)) }
1653
+ attr_writer :payment
1654
+
1655
+ sig { params(totals: T.nilable(Totals)).returns(T.nilable(Totals)) }
1656
+ attr_writer :totals
1657
+
1658
+ sig { params(notes: T::Array[Note]).returns(T::Array[Note]) }
1659
+ attr_writer :notes
1660
+
1661
+ sig { returns(T::Array[Note]) }
1662
+ attr_reader :notes
1663
+
1664
+ sig { params(lines: T::Array[Line]).returns(T::Array[Line]) }
1665
+ attr_writer :lines
1666
+
1667
+ sig { returns(T::Array[Line]) }
1668
+ attr_reader :lines
1669
+
1670
+ sig { params(tax_breakdowns: T::Array[TaxBreakdown]).returns(T::Array[TaxBreakdown]) }
1671
+ attr_writer :tax_breakdowns
1672
+
1673
+ sig { returns(T::Array[TaxBreakdown]) }
1674
+ attr_reader :tax_breakdowns
1675
+
1676
+ sig { params(allowances: T::Array[AllowanceCharge]).returns(T::Array[AllowanceCharge]) }
1677
+ attr_writer :allowances
1678
+
1679
+ sig { params(charges: T::Array[AllowanceCharge]).returns(T::Array[AllowanceCharge]) }
1680
+ attr_writer :charges
1681
+
1682
+ sig { returns(T::Array[AllowanceCharge]) }
1683
+ attr_reader :allowances, :charges
1684
+
1685
+ sig do
1686
+ params(preceding_invoices: T::Array[DocumentReference]).returns(T::Array[DocumentReference])
1687
+ end
1688
+ attr_writer :preceding_invoices
1689
+
1690
+ sig { returns(T::Array[DocumentReference]) }
1691
+ attr_reader :preceding_invoices
1692
+
1693
+ sig do
1694
+ params(supporting_documents: T::Array[SupportingDocument]).returns(T::Array[SupportingDocument])
1695
+ end
1696
+ attr_writer :supporting_documents
1697
+
1698
+ sig { returns(T::Array[SupportingDocument]) }
1699
+ attr_reader :supporting_documents
1700
+
1701
+ sig { params(value: DocumentReference, attributes: T.untyped, block: T.nilable(T.proc.params(builder: DocumentReferenceBuilder).void)).returns(DocumentReference) }
1702
+ def project_reference(value = T.unsafe(nil), **attributes, &block); end
1703
+ sig { params(value: DocumentReference, attributes: T.untyped, block: T.nilable(T.proc.params(builder: DocumentReferenceBuilder).void)).returns(DocumentReference) }
1704
+ def contract_reference(value = T.unsafe(nil), **attributes, &block); end
1705
+ sig { params(value: DocumentReference, attributes: T.untyped, block: T.nilable(T.proc.params(builder: DocumentReferenceBuilder).void)).returns(DocumentReference) }
1706
+ def purchase_order_reference(value = T.unsafe(nil), **attributes, &block); end
1707
+ sig { params(value: DocumentReference, attributes: T.untyped, block: T.nilable(T.proc.params(builder: DocumentReferenceBuilder).void)).returns(DocumentReference) }
1708
+ def sales_order_reference(value = T.unsafe(nil), **attributes, &block); end
1709
+ sig { params(value: DocumentReference, attributes: T.untyped, block: T.nilable(T.proc.params(builder: DocumentReferenceBuilder).void)).returns(DocumentReference) }
1710
+ def receiving_advice_reference(value = T.unsafe(nil), **attributes, &block); end
1711
+ sig { params(value: DocumentReference, attributes: T.untyped, block: T.nilable(T.proc.params(builder: DocumentReferenceBuilder).void)).returns(DocumentReference) }
1712
+ def despatch_advice_reference(value = T.unsafe(nil), **attributes, &block); end
1713
+ sig { params(value: DocumentReference, attributes: T.untyped, block: T.nilable(T.proc.params(builder: DocumentReferenceBuilder).void)).returns(DocumentReference) }
1714
+ def tender_or_lot_reference(value = T.unsafe(nil), **attributes, &block); end
1715
+ sig { params(value: Identifier, attributes: T.untyped, block: T.nilable(T.proc.params(builder: IdentifierBuilder).void)).returns(Identifier) }
1716
+ def invoiced_object_identifier(value = T.unsafe(nil), **attributes, &block); end
1717
+ sig { params(value: Party, attributes: T.untyped, block: T.nilable(T.proc.params(builder: PartyBuilder).void)).returns(Party) }
1718
+ def seller(value = T.unsafe(nil), **attributes, &block); end
1719
+ sig { params(value: Party, attributes: T.untyped, block: T.nilable(T.proc.params(builder: PartyBuilder).void)).returns(Party) }
1720
+ def buyer(value = T.unsafe(nil), **attributes, &block); end
1721
+ sig { params(value: Party, attributes: T.untyped, block: T.nilable(T.proc.params(builder: PartyBuilder).void)).returns(Party) }
1722
+ def payee(value = T.unsafe(nil), **attributes, &block); end
1723
+ sig { params(value: Party, attributes: T.untyped, block: T.nilable(T.proc.params(builder: PartyBuilder).void)).returns(Party) }
1724
+ def tax_representative(value = T.unsafe(nil), **attributes, &block); end
1725
+ sig { params(value: Delivery, attributes: T.untyped, block: T.nilable(T.proc.params(builder: DeliveryBuilder).void)).returns(Delivery) }
1726
+ def delivery(value = T.unsafe(nil), **attributes, &block); end
1727
+ sig { params(value: Period, attributes: T.untyped, block: T.nilable(T.proc.params(builder: PeriodBuilder).void)).returns(Period) }
1728
+ def billing_period(value = T.unsafe(nil), **attributes, &block); end
1729
+ sig { params(value: PaymentInstructions, attributes: T.untyped, block: T.nilable(T.proc.params(builder: PaymentInstructionsBuilder).void)).returns(PaymentInstructions) }
1730
+ def payment(value = T.unsafe(nil), **attributes, &block); end
1731
+ sig { params(value: Totals, attributes: T.untyped, block: T.nilable(T.proc.params(builder: TotalsBuilder).void)).returns(Totals) }
1732
+ def totals(value = T.unsafe(nil), **attributes, &block); end
1733
+ sig { params(value: Note, attributes: T.untyped, block: T.nilable(T.proc.params(builder: NoteBuilder).void)).returns(Note) }
1734
+ def note(value = T.unsafe(nil), **attributes, &block); end
1735
+ sig { params(value: Line, attributes: T.untyped, block: T.nilable(T.proc.params(builder: LineBuilder).void)).returns(Line) }
1736
+ def line(value = T.unsafe(nil), **attributes, &block); end
1737
+ sig { params(value: TaxBreakdown, attributes: T.untyped, block: T.nilable(T.proc.params(builder: TaxBreakdownBuilder).void)).returns(TaxBreakdown) }
1738
+ def tax_breakdown(value = T.unsafe(nil), **attributes, &block); end
1739
+ sig { params(value: AllowanceCharge, attributes: T.untyped, block: T.nilable(T.proc.params(builder: AllowanceChargeBuilder).void)).returns(AllowanceCharge) }
1740
+ def allowance(value = T.unsafe(nil), **attributes, &block); end
1741
+ sig { params(value: AllowanceCharge, attributes: T.untyped, block: T.nilable(T.proc.params(builder: AllowanceChargeBuilder).void)).returns(AllowanceCharge) }
1742
+ def charge(value = T.unsafe(nil), **attributes, &block); end
1743
+ sig { params(value: DocumentReference, attributes: T.untyped, block: T.nilable(T.proc.params(builder: DocumentReferenceBuilder).void)).returns(DocumentReference) }
1744
+ def preceding_invoice(value = T.unsafe(nil), **attributes, &block); end
1745
+ sig { params(value: SupportingDocument, attributes: T.untyped, block: T.nilable(T.proc.params(builder: SupportingDocumentBuilder).void)).returns(SupportingDocument) }
1746
+ def supporting_document(value = T.unsafe(nil), **attributes, &block); end
1747
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(builder: DocumentBuilder).void)).returns(Document) }
1748
+ def self.build(**attributes, &block); end
1749
+ sig { returns(Document) }
1750
+ def build; end
1751
+ end
1752
+ end
1753
+
1754
+ private_constant :Builders
1755
+ end