e-invoice-api 0.6.0 → 0.8.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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +5 -5
  4. data/lib/e_invoice_api/client.rb +4 -0
  5. data/lib/e_invoice_api/internal/type/base_model.rb +5 -5
  6. data/lib/e_invoice_api/models/allowance.rb +96 -0
  7. data/lib/e_invoice_api/models/charge.rb +96 -0
  8. data/lib/e_invoice_api/models/document_create.rb +666 -19
  9. data/lib/e_invoice_api/models/document_create_from_pdf_params.rb +32 -0
  10. data/lib/e_invoice_api/models/document_create_from_pdf_response.rb +584 -0
  11. data/lib/e_invoice_api/models/document_response.rb +265 -23
  12. data/lib/e_invoice_api/models/document_validate_params.rb +14 -0
  13. data/lib/e_invoice_api/models/documents/ubl_create_from_ubl_params.rb +22 -0
  14. data/lib/e_invoice_api/models/me_retrieve_params.rb +14 -0
  15. data/lib/e_invoice_api/models/me_retrieve_response.rb +149 -0
  16. data/lib/e_invoice_api/models.rb +10 -0
  17. data/lib/e_invoice_api/resources/documents/ubl.rb +22 -0
  18. data/lib/e_invoice_api/resources/documents.rb +64 -8
  19. data/lib/e_invoice_api/resources/me.rb +32 -0
  20. data/lib/e_invoice_api/resources/validate.rb +12 -8
  21. data/lib/e_invoice_api/version.rb +1 -1
  22. data/lib/e_invoice_api.rb +9 -0
  23. data/rbi/e_invoice_api/client.rbi +3 -0
  24. data/rbi/e_invoice_api/models/allowance.rbi +124 -0
  25. data/rbi/e_invoice_api/models/charge.rbi +122 -0
  26. data/rbi/e_invoice_api/models/document_create.rbi +1180 -3
  27. data/rbi/e_invoice_api/models/document_create_from_pdf_params.rbi +56 -0
  28. data/rbi/e_invoice_api/models/document_create_from_pdf_response.rbi +1014 -0
  29. data/rbi/e_invoice_api/models/document_response.rbi +456 -43
  30. data/rbi/e_invoice_api/models/document_validate_params.rbi +30 -0
  31. data/rbi/e_invoice_api/models/documents/ubl_create_from_ubl_params.rbi +43 -0
  32. data/rbi/e_invoice_api/models/me_retrieve_params.rbi +27 -0
  33. data/rbi/e_invoice_api/models/me_retrieve_response.rbi +195 -0
  34. data/rbi/e_invoice_api/models.rbi +10 -0
  35. data/rbi/e_invoice_api/resources/documents/ubl.rbi +10 -0
  36. data/rbi/e_invoice_api/resources/documents.rbi +54 -1
  37. data/rbi/e_invoice_api/resources/me.rbi +21 -0
  38. data/rbi/e_invoice_api/resources/validate.rbi +20 -1
  39. data/sig/e_invoice_api/client.rbs +2 -0
  40. data/sig/e_invoice_api/models/allowance.rbs +69 -0
  41. data/sig/e_invoice_api/models/charge.rbs +69 -0
  42. data/sig/e_invoice_api/models/document_create.rbs +388 -4
  43. data/sig/e_invoice_api/models/document_create_from_pdf_params.rbs +36 -0
  44. data/sig/e_invoice_api/models/document_create_from_pdf_response.rbs +512 -0
  45. data/sig/e_invoice_api/models/document_response.rbs +168 -32
  46. data/sig/e_invoice_api/models/document_validate_params.rbs +15 -0
  47. data/sig/e_invoice_api/models/documents/ubl_create_from_ubl_params.rbs +26 -0
  48. data/sig/e_invoice_api/models/me_retrieve_params.rbs +15 -0
  49. data/sig/e_invoice_api/models/me_retrieve_response.rbs +107 -0
  50. data/sig/e_invoice_api/models.rbs +10 -0
  51. data/sig/e_invoice_api/resources/documents/ubl.rbs +5 -0
  52. data/sig/e_invoice_api/resources/documents.rbs +15 -1
  53. data/sig/e_invoice_api/resources/me.rbs +11 -0
  54. data/sig/e_invoice_api/resources/validate.rbs +3 -1
  55. metadata +28 -1
@@ -9,7 +9,16 @@ module EInvoiceAPI
9
9
  # @return [String]
10
10
  required :id, String
11
11
 
12
+ # @!attribute allowances
13
+ #
14
+ # @return [Array<EInvoiceAPI::Models::DocumentResponse::Allowance>, nil]
15
+ optional :allowances,
16
+ -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::DocumentResponse::Allowance] },
17
+ nil?: true
18
+
12
19
  # @!attribute amount_due
20
+ # The amount due of the invoice. Must be positive and rounded to maximum 2
21
+ # decimals
13
22
  #
14
23
  # @return [String, nil]
15
24
  optional :amount_due, String, nil?: true
@@ -18,7 +27,8 @@ module EInvoiceAPI
18
27
  #
19
28
  # @return [Array<EInvoiceAPI::Models::Documents::DocumentAttachment>, nil]
20
29
  optional :attachments,
21
- -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::Documents::DocumentAttachment] }
30
+ -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::Documents::DocumentAttachment] },
31
+ nil?: true
22
32
 
23
33
  # @!attribute billing_address
24
34
  #
@@ -30,6 +40,13 @@ module EInvoiceAPI
30
40
  # @return [String, nil]
31
41
  optional :billing_address_recipient, String, nil?: true
32
42
 
43
+ # @!attribute charges
44
+ #
45
+ # @return [Array<EInvoiceAPI::Models::DocumentResponse::Charge>, nil]
46
+ optional :charges,
47
+ -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::DocumentResponse::Charge] },
48
+ nil?: true
49
+
33
50
  # @!attribute currency
34
51
  # Currency of the invoice
35
52
  #
@@ -92,6 +109,8 @@ module EInvoiceAPI
92
109
  optional :invoice_id, String, nil?: true
93
110
 
94
111
  # @!attribute invoice_total
112
+ # The total amount of the invoice (so invoice_total = subtotal + total_tax +
113
+ # total_discount). Must be positive and rounded to maximum 2 decimals
95
114
  #
96
115
  # @return [String, nil]
97
116
  optional :invoice_total, String, nil?: true
@@ -99,7 +118,9 @@ module EInvoiceAPI
99
118
  # @!attribute items
100
119
  #
101
120
  # @return [Array<EInvoiceAPI::Models::DocumentResponse::Item>, nil]
102
- optional :items, -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::DocumentResponse::Item] }
121
+ optional :items,
122
+ -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::DocumentResponse::Item] },
123
+ nil?: true
103
124
 
104
125
  # @!attribute note
105
126
  #
@@ -110,7 +131,8 @@ module EInvoiceAPI
110
131
  #
111
132
  # @return [Array<EInvoiceAPI::Models::DocumentResponse::PaymentDetail>, nil]
112
133
  optional :payment_details,
113
- -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::DocumentResponse::PaymentDetail] }
134
+ -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::DocumentResponse::PaymentDetail] },
135
+ nil?: true
114
136
 
115
137
  # @!attribute payment_term
116
138
  #
@@ -118,6 +140,8 @@ module EInvoiceAPI
118
140
  optional :payment_term, String, nil?: true
119
141
 
120
142
  # @!attribute previous_unpaid_balance
143
+ # The previous unpaid balance of the invoice, if any. Must be positive and rounded
144
+ # to maximum 2 decimals
121
145
  #
122
146
  # @return [String, nil]
123
147
  optional :previous_unpaid_balance, String, nil?: true
@@ -173,6 +197,9 @@ module EInvoiceAPI
173
197
  optional :state, enum: -> { EInvoiceAPI::DocumentState }
174
198
 
175
199
  # @!attribute subtotal
200
+ # The taxable base of the invoice. Should be the sum of all line items -
201
+ # allowances (for example commercial discounts) + charges with impact on VAT. Must
202
+ # be positive and rounded to maximum 2 decimals
176
203
  #
177
204
  # @return [String, nil]
178
205
  optional :subtotal, String, nil?: true
@@ -187,14 +214,18 @@ module EInvoiceAPI
187
214
  #
188
215
  # @return [Array<EInvoiceAPI::Models::DocumentResponse::TaxDetail>, nil]
189
216
  optional :tax_details,
190
- -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::DocumentResponse::TaxDetail] }
217
+ -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::DocumentResponse::TaxDetail] },
218
+ nil?: true
191
219
 
192
220
  # @!attribute total_discount
221
+ # The total financial discount of the invoice (so discounts not subject to VAT).
222
+ # Must be positive and rounded to maximum 2 decimals
193
223
  #
194
224
  # @return [String, nil]
195
225
  optional :total_discount, String, nil?: true
196
226
 
197
227
  # @!attribute total_tax
228
+ # The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
198
229
  #
199
230
  # @return [String, nil]
200
231
  optional :total_tax, String, nil?: true
@@ -238,20 +269,24 @@ module EInvoiceAPI
238
269
  # @return [String, nil]
239
270
  optional :vendor_tax_id, String, nil?: true
240
271
 
241
- # @!method initialize(id:, amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, previous_unpaid_balance: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, tax_code: nil, tax_details: nil, total_discount: nil, total_tax: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_email: nil, vendor_name: nil, vendor_tax_id: nil)
272
+ # @!method initialize(id:, allowances: nil, amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, charges: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, previous_unpaid_balance: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, tax_code: nil, tax_details: nil, total_discount: nil, total_tax: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_email: nil, vendor_name: nil, vendor_tax_id: nil)
242
273
  # Some parameter documentations has been truncated, see
243
274
  # {EInvoiceAPI::Models::DocumentResponse} for more details.
244
275
  #
245
276
  # @param id [String]
246
277
  #
247
- # @param amount_due [String, nil]
278
+ # @param allowances [Array<EInvoiceAPI::Models::DocumentResponse::Allowance>, nil]
279
+ #
280
+ # @param amount_due [String, nil] The amount due of the invoice. Must be positive and rounded to maximum 2 decimal
248
281
  #
249
- # @param attachments [Array<EInvoiceAPI::Models::Documents::DocumentAttachment>]
282
+ # @param attachments [Array<EInvoiceAPI::Models::Documents::DocumentAttachment>, nil]
250
283
  #
251
284
  # @param billing_address [String, nil]
252
285
  #
253
286
  # @param billing_address_recipient [String, nil]
254
287
  #
288
+ # @param charges [Array<EInvoiceAPI::Models::DocumentResponse::Charge>, nil]
289
+ #
255
290
  # @param currency [Symbol, EInvoiceAPI::Models::CurrencyCode] Currency of the invoice
256
291
  #
257
292
  # @param customer_address [String, nil]
@@ -276,17 +311,17 @@ module EInvoiceAPI
276
311
  #
277
312
  # @param invoice_id [String, nil]
278
313
  #
279
- # @param invoice_total [String, nil]
314
+ # @param invoice_total [String, nil] The total amount of the invoice (so invoice_total = subtotal + total_tax + total
280
315
  #
281
- # @param items [Array<EInvoiceAPI::Models::DocumentResponse::Item>]
316
+ # @param items [Array<EInvoiceAPI::Models::DocumentResponse::Item>, nil]
282
317
  #
283
318
  # @param note [String, nil]
284
319
  #
285
- # @param payment_details [Array<EInvoiceAPI::Models::DocumentResponse::PaymentDetail>]
320
+ # @param payment_details [Array<EInvoiceAPI::Models::DocumentResponse::PaymentDetail>, nil]
286
321
  #
287
322
  # @param payment_term [String, nil]
288
323
  #
289
- # @param previous_unpaid_balance [String, nil]
324
+ # @param previous_unpaid_balance [String, nil] The previous unpaid balance of the invoice, if any. Must be positive and rounded
290
325
  #
291
326
  # @param purchase_order [String, nil]
292
327
  #
@@ -308,15 +343,15 @@ module EInvoiceAPI
308
343
  #
309
344
  # @param state [Symbol, EInvoiceAPI::Models::DocumentState]
310
345
  #
311
- # @param subtotal [String, nil]
346
+ # @param subtotal [String, nil] The taxable base of the invoice. Should be the sum of all line items - allowance
312
347
  #
313
348
  # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentResponse::TaxCode] Tax category code of the invoice
314
349
  #
315
- # @param tax_details [Array<EInvoiceAPI::Models::DocumentResponse::TaxDetail>]
350
+ # @param tax_details [Array<EInvoiceAPI::Models::DocumentResponse::TaxDetail>, nil]
316
351
  #
317
- # @param total_discount [String, nil]
352
+ # @param total_discount [String, nil] The total financial discount of the invoice (so discounts not subject to VAT). M
318
353
  #
319
- # @param total_tax [String, nil]
354
+ # @param total_tax [String, nil] The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
320
355
  #
321
356
  # @param vatex [Symbol, EInvoiceAPI::Models::DocumentResponse::Vatex, nil] VATEX code list for VAT exemption reasons
322
357
  #
@@ -332,38 +367,237 @@ module EInvoiceAPI
332
367
  #
333
368
  # @param vendor_tax_id [String, nil]
334
369
 
370
+ class Allowance < EInvoiceAPI::Internal::Type::BaseModel
371
+ # @!attribute amount
372
+ # The allowance amount, without VAT. Must be rounded to maximum 2 decimals
373
+ #
374
+ # @return [String, nil]
375
+ optional :amount, String, nil?: true
376
+
377
+ # @!attribute base_amount
378
+ # The base amount that may be used, in conjunction with the allowance percentage,
379
+ # to calculate the allowance amount. Must be rounded to maximum 2 decimals
380
+ #
381
+ # @return [String, nil]
382
+ optional :base_amount, String, nil?: true
383
+
384
+ # @!attribute multiplier_factor
385
+ # The percentage that may be used, in conjunction with the allowance base amount,
386
+ # to calculate the allowance amount. To state 20%, use value 20
387
+ #
388
+ # @return [String, nil]
389
+ optional :multiplier_factor, String, nil?: true
390
+
391
+ # @!attribute reason
392
+ # The reason for the allowance
393
+ #
394
+ # @return [String, nil]
395
+ optional :reason, String, nil?: true
396
+
397
+ # @!attribute reason_code
398
+ # The code for the allowance reason
399
+ #
400
+ # @return [String, nil]
401
+ optional :reason_code, String, nil?: true
402
+
403
+ # @!attribute tax_code
404
+ # Duty or tax or fee category codes (Subset of UNCL5305)
405
+ #
406
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
407
+ #
408
+ # @return [Symbol, EInvoiceAPI::Models::DocumentResponse::Allowance::TaxCode, nil]
409
+ optional :tax_code, enum: -> { EInvoiceAPI::DocumentResponse::Allowance::TaxCode }, nil?: true
410
+
411
+ # @!attribute tax_rate
412
+ # The VAT rate, represented as percentage that applies to the allowance
413
+ #
414
+ # @return [String, nil]
415
+ optional :tax_rate, String, nil?: true
416
+
417
+ # @!method initialize(amount: nil, base_amount: nil, multiplier_factor: nil, reason: nil, reason_code: nil, tax_code: nil, tax_rate: nil)
418
+ # Some parameter documentations has been truncated, see
419
+ # {EInvoiceAPI::Models::DocumentResponse::Allowance} for more details.
420
+ #
421
+ # @param amount [String, nil] The allowance amount, without VAT. Must be rounded to maximum 2 decimals
422
+ #
423
+ # @param base_amount [String, nil] The base amount that may be used, in conjunction with the allowance percentage,
424
+ #
425
+ # @param multiplier_factor [String, nil] The percentage that may be used, in conjunction with the allowance base amount,
426
+ #
427
+ # @param reason [String, nil] The reason for the allowance
428
+ #
429
+ # @param reason_code [String, nil] The code for the allowance reason
430
+ #
431
+ # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentResponse::Allowance::TaxCode, nil] Duty or tax or fee category codes (Subset of UNCL5305)
432
+ #
433
+ # @param tax_rate [String, nil] The VAT rate, represented as percentage that applies to the allowance
434
+
435
+ # Duty or tax or fee category codes (Subset of UNCL5305)
436
+ #
437
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
438
+ #
439
+ # @see EInvoiceAPI::Models::DocumentResponse::Allowance#tax_code
440
+ module TaxCode
441
+ extend EInvoiceAPI::Internal::Type::Enum
442
+
443
+ AE = :AE
444
+ E = :E
445
+ S = :S
446
+ Z = :Z
447
+ G = :G
448
+ O = :O
449
+ K = :K
450
+ L = :L
451
+ M = :M
452
+ B = :B
453
+
454
+ # @!method self.values
455
+ # @return [Array<Symbol>]
456
+ end
457
+ end
458
+
459
+ class Charge < EInvoiceAPI::Internal::Type::BaseModel
460
+ # @!attribute amount
461
+ # The charge amount, without VAT. Must be rounded to maximum 2 decimals
462
+ #
463
+ # @return [String, nil]
464
+ optional :amount, String, nil?: true
465
+
466
+ # @!attribute base_amount
467
+ # The base amount that may be used, in conjunction with the charge percentage, to
468
+ # calculate the charge amount. Must be rounded to maximum 2 decimals
469
+ #
470
+ # @return [String, nil]
471
+ optional :base_amount, String, nil?: true
472
+
473
+ # @!attribute multiplier_factor
474
+ # The percentage that may be used, in conjunction with the charge base amount, to
475
+ # calculate the charge amount. To state 20%, use value 20
476
+ #
477
+ # @return [String, nil]
478
+ optional :multiplier_factor, String, nil?: true
479
+
480
+ # @!attribute reason
481
+ # The reason for the charge
482
+ #
483
+ # @return [String, nil]
484
+ optional :reason, String, nil?: true
485
+
486
+ # @!attribute reason_code
487
+ # The code for the charge reason
488
+ #
489
+ # @return [String, nil]
490
+ optional :reason_code, String, nil?: true
491
+
492
+ # @!attribute tax_code
493
+ # Duty or tax or fee category codes (Subset of UNCL5305)
494
+ #
495
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
496
+ #
497
+ # @return [Symbol, EInvoiceAPI::Models::DocumentResponse::Charge::TaxCode, nil]
498
+ optional :tax_code, enum: -> { EInvoiceAPI::DocumentResponse::Charge::TaxCode }, nil?: true
499
+
500
+ # @!attribute tax_rate
501
+ # The VAT rate, represented as percentage that applies to the charge
502
+ #
503
+ # @return [String, nil]
504
+ optional :tax_rate, String, nil?: true
505
+
506
+ # @!method initialize(amount: nil, base_amount: nil, multiplier_factor: nil, reason: nil, reason_code: nil, tax_code: nil, tax_rate: nil)
507
+ # Some parameter documentations has been truncated, see
508
+ # {EInvoiceAPI::Models::DocumentResponse::Charge} for more details.
509
+ #
510
+ # @param amount [String, nil] The charge amount, without VAT. Must be rounded to maximum 2 decimals
511
+ #
512
+ # @param base_amount [String, nil] The base amount that may be used, in conjunction with the charge percentage, to
513
+ #
514
+ # @param multiplier_factor [String, nil] The percentage that may be used, in conjunction with the charge base amount, to
515
+ #
516
+ # @param reason [String, nil] The reason for the charge
517
+ #
518
+ # @param reason_code [String, nil] The code for the charge reason
519
+ #
520
+ # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentResponse::Charge::TaxCode, nil] Duty or tax or fee category codes (Subset of UNCL5305)
521
+ #
522
+ # @param tax_rate [String, nil] The VAT rate, represented as percentage that applies to the charge
523
+
524
+ # Duty or tax or fee category codes (Subset of UNCL5305)
525
+ #
526
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
527
+ #
528
+ # @see EInvoiceAPI::Models::DocumentResponse::Charge#tax_code
529
+ module TaxCode
530
+ extend EInvoiceAPI::Internal::Type::Enum
531
+
532
+ AE = :AE
533
+ E = :E
534
+ S = :S
535
+ Z = :Z
536
+ G = :G
537
+ O = :O
538
+ K = :K
539
+ L = :L
540
+ M = :M
541
+ B = :B
542
+
543
+ # @!method self.values
544
+ # @return [Array<Symbol>]
545
+ end
546
+ end
547
+
335
548
  class Item < EInvoiceAPI::Internal::Type::BaseModel
549
+ # @!attribute allowances
550
+ # The allowances of the line item.
551
+ #
552
+ # @return [Array<EInvoiceAPI::Models::Allowance>, nil]
553
+ optional :allowances, -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::Allowance] }, nil?: true
554
+
336
555
  # @!attribute amount
556
+ # The total amount of the line item, exclusive of VAT, after subtracting line
557
+ # level allowances and adding line level charges. Must be rounded to maximum 2
558
+ # decimals
337
559
  #
338
560
  # @return [String, nil]
339
561
  optional :amount, String, nil?: true
340
562
 
563
+ # @!attribute charges
564
+ # The charges of the line item.
565
+ #
566
+ # @return [Array<EInvoiceAPI::Models::Charge>, nil]
567
+ optional :charges, -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::Charge] }, nil?: true
568
+
341
569
  # @!attribute date
342
570
  #
343
571
  # @return [nil]
344
572
  optional :date, NilClass
345
573
 
346
574
  # @!attribute description
575
+ # The description of the line item.
347
576
  #
348
577
  # @return [String, nil]
349
578
  optional :description, String, nil?: true
350
579
 
351
580
  # @!attribute product_code
581
+ # The product code of the line item.
352
582
  #
353
583
  # @return [String, nil]
354
584
  optional :product_code, String, nil?: true
355
585
 
356
586
  # @!attribute quantity
587
+ # The quantity of items (goods or services) that is the subject of the line item.
588
+ # Must be rounded to maximum 4 decimals
357
589
  #
358
590
  # @return [String, nil]
359
591
  optional :quantity, String, nil?: true
360
592
 
361
593
  # @!attribute tax
594
+ # The total VAT amount for the line item. Must be rounded to maximum 2 decimals
362
595
  #
363
596
  # @return [String, nil]
364
597
  optional :tax, String, nil?: true
365
598
 
366
599
  # @!attribute tax_rate
600
+ # The VAT rate of the line item expressed as percentage with 2 decimals
367
601
  #
368
602
  # @return [String, nil]
369
603
  optional :tax_rate, String, nil?: true
@@ -375,28 +609,36 @@ module EInvoiceAPI
375
609
  optional :unit, enum: -> { EInvoiceAPI::UnitOfMeasureCode }, nil?: true
376
610
 
377
611
  # @!attribute unit_price
612
+ # The unit price of the line item. Must be rounded to maximum 2 decimals
378
613
  #
379
614
  # @return [String, nil]
380
615
  optional :unit_price, String, nil?: true
381
616
 
382
- # @!method initialize(amount: nil, date: nil, description: nil, product_code: nil, quantity: nil, tax: nil, tax_rate: nil, unit: nil, unit_price: nil)
383
- # @param amount [String, nil]
617
+ # @!method initialize(allowances: nil, amount: nil, charges: nil, date: nil, description: nil, product_code: nil, quantity: nil, tax: nil, tax_rate: nil, unit: nil, unit_price: nil)
618
+ # Some parameter documentations has been truncated, see
619
+ # {EInvoiceAPI::Models::DocumentResponse::Item} for more details.
620
+ #
621
+ # @param allowances [Array<EInvoiceAPI::Models::Allowance>, nil] The allowances of the line item.
622
+ #
623
+ # @param amount [String, nil] The total amount of the line item, exclusive of VAT, after subtracting line leve
624
+ #
625
+ # @param charges [Array<EInvoiceAPI::Models::Charge>, nil] The charges of the line item.
384
626
  #
385
627
  # @param date [nil]
386
628
  #
387
- # @param description [String, nil]
629
+ # @param description [String, nil] The description of the line item.
388
630
  #
389
- # @param product_code [String, nil]
631
+ # @param product_code [String, nil] The product code of the line item.
390
632
  #
391
- # @param quantity [String, nil]
633
+ # @param quantity [String, nil] The quantity of items (goods or services) that is the subject of the line item.
392
634
  #
393
- # @param tax [String, nil]
635
+ # @param tax [String, nil] The total VAT amount for the line item. Must be rounded to maximum 2 decimals
394
636
  #
395
- # @param tax_rate [String, nil]
637
+ # @param tax_rate [String, nil] The VAT rate of the line item expressed as percentage with 2 decimals
396
638
  #
397
639
  # @param unit [Symbol, EInvoiceAPI::Models::UnitOfMeasureCode, nil] Unit of Measure Codes from UNECERec20 used in Peppol BIS Billing 3.0.
398
640
  #
399
- # @param unit_price [String, nil]
641
+ # @param unit_price [String, nil] The unit price of the line item. Must be rounded to maximum 2 decimals
400
642
  end
401
643
 
402
644
  class PaymentDetail < EInvoiceAPI::Internal::Type::BaseModel
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ # @see EInvoiceAPI::Resources::Documents#validate
6
+ class DocumentValidateParams < EInvoiceAPI::Internal::Type::BaseModel
7
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
8
+ include EInvoiceAPI::Internal::Type::RequestParameters
9
+
10
+ # @!method initialize(request_options: {})
11
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ module Documents
6
+ # @see EInvoiceAPI::Resources::Documents::Ubl#create_from_ubl
7
+ class UblCreateFromUblParams < EInvoiceAPI::Internal::Type::BaseModel
8
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
9
+ include EInvoiceAPI::Internal::Type::RequestParameters
10
+
11
+ # @!attribute file
12
+ #
13
+ # @return [Pathname, StringIO, IO, String, EInvoiceAPI::FilePart]
14
+ required :file, EInvoiceAPI::Internal::Type::FileInput
15
+
16
+ # @!method initialize(file:, request_options: {})
17
+ # @param file [Pathname, StringIO, IO, String, EInvoiceAPI::FilePart]
18
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ # @see EInvoiceAPI::Resources::Me#retrieve
6
+ class MeRetrieveParams < EInvoiceAPI::Internal::Type::BaseModel
7
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
8
+ include EInvoiceAPI::Internal::Type::RequestParameters
9
+
10
+ # @!method initialize(request_options: {})
11
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,149 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ # @see EInvoiceAPI::Resources::Me#retrieve
6
+ class MeRetrieveResponse < EInvoiceAPI::Internal::Type::BaseModel
7
+ # @!attribute credit_balance
8
+ # Credit balance of the tenant
9
+ #
10
+ # @return [Integer]
11
+ required :credit_balance, Integer
12
+
13
+ # @!attribute name
14
+ #
15
+ # @return [String]
16
+ required :name, String
17
+
18
+ # @!attribute plan
19
+ # Plan of the tenant
20
+ #
21
+ # @return [Symbol, EInvoiceAPI::Models::MeRetrieveResponse::Plan]
22
+ required :plan, enum: -> { EInvoiceAPI::Models::MeRetrieveResponse::Plan }
23
+
24
+ # @!attribute bcc_recipient_email
25
+ # BCC recipient email to deliver documents
26
+ #
27
+ # @return [String, nil]
28
+ optional :bcc_recipient_email, String, nil?: true
29
+
30
+ # @!attribute company_address
31
+ # Address of the company
32
+ #
33
+ # @return [String, nil]
34
+ optional :company_address, String, nil?: true
35
+
36
+ # @!attribute company_city
37
+ # City of the company
38
+ #
39
+ # @return [String, nil]
40
+ optional :company_city, String, nil?: true
41
+
42
+ # @!attribute company_country
43
+ # Country of the company
44
+ #
45
+ # @return [String, nil]
46
+ optional :company_country, String, nil?: true
47
+
48
+ # @!attribute company_email
49
+ # Email of the company
50
+ #
51
+ # @return [String, nil]
52
+ optional :company_email, String, nil?: true
53
+
54
+ # @!attribute company_name
55
+ # Name of the company
56
+ #
57
+ # @return [String, nil]
58
+ optional :company_name, String, nil?: true
59
+
60
+ # @!attribute company_number
61
+ # Company number
62
+ #
63
+ # @return [String, nil]
64
+ optional :company_number, String, nil?: true
65
+
66
+ # @!attribute company_zip
67
+ # Zip code of the company
68
+ #
69
+ # @return [String, nil]
70
+ optional :company_zip, String, nil?: true
71
+
72
+ # @!attribute description
73
+ #
74
+ # @return [String, nil]
75
+ optional :description, String, nil?: true
76
+
77
+ # @!attribute ibans
78
+ # IBANs of the tenant
79
+ #
80
+ # @return [Array<String>, nil]
81
+ optional :ibans, EInvoiceAPI::Internal::Type::ArrayOf[String], nil?: true
82
+
83
+ # @!attribute peppol_ids
84
+ # Peppol IDs of the tenant
85
+ #
86
+ # @return [Array<String>, nil]
87
+ optional :peppol_ids, EInvoiceAPI::Internal::Type::ArrayOf[String], nil?: true
88
+
89
+ # @!attribute smp_registration
90
+ # Whether the tenant is registered on our SMP
91
+ #
92
+ # @return [Boolean, nil]
93
+ optional :smp_registration, EInvoiceAPI::Internal::Type::Boolean, nil?: true
94
+
95
+ # @!attribute smp_registration_date
96
+ # Date when the tenant was registered on SMP
97
+ #
98
+ # @return [Time, nil]
99
+ optional :smp_registration_date, Time, nil?: true
100
+
101
+ # @!method initialize(credit_balance:, name:, plan:, bcc_recipient_email: nil, company_address: nil, company_city: nil, company_country: nil, company_email: nil, company_name: nil, company_number: nil, company_zip: nil, description: nil, ibans: nil, peppol_ids: nil, smp_registration: nil, smp_registration_date: nil)
102
+ # @param credit_balance [Integer] Credit balance of the tenant
103
+ #
104
+ # @param name [String]
105
+ #
106
+ # @param plan [Symbol, EInvoiceAPI::Models::MeRetrieveResponse::Plan] Plan of the tenant
107
+ #
108
+ # @param bcc_recipient_email [String, nil] BCC recipient email to deliver documents
109
+ #
110
+ # @param company_address [String, nil] Address of the company
111
+ #
112
+ # @param company_city [String, nil] City of the company
113
+ #
114
+ # @param company_country [String, nil] Country of the company
115
+ #
116
+ # @param company_email [String, nil] Email of the company
117
+ #
118
+ # @param company_name [String, nil] Name of the company
119
+ #
120
+ # @param company_number [String, nil] Company number
121
+ #
122
+ # @param company_zip [String, nil] Zip code of the company
123
+ #
124
+ # @param description [String, nil]
125
+ #
126
+ # @param ibans [Array<String>, nil] IBANs of the tenant
127
+ #
128
+ # @param peppol_ids [Array<String>, nil] Peppol IDs of the tenant
129
+ #
130
+ # @param smp_registration [Boolean, nil] Whether the tenant is registered on our SMP
131
+ #
132
+ # @param smp_registration_date [Time, nil] Date when the tenant was registered on SMP
133
+
134
+ # Plan of the tenant
135
+ #
136
+ # @see EInvoiceAPI::Models::MeRetrieveResponse#plan
137
+ module Plan
138
+ extend EInvoiceAPI::Internal::Type::Enum
139
+
140
+ STARTER = :starter
141
+ PRO = :pro
142
+ ENTERPRISE = :enterprise
143
+
144
+ # @!method self.values
145
+ # @return [Array<Symbol>]
146
+ end
147
+ end
148
+ end
149
+ end