e-invoice-api 0.7.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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -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_from_pdf_params.rb +32 -0
  9. data/lib/e_invoice_api/models/document_create_from_pdf_response.rb +584 -0
  10. data/lib/e_invoice_api/models/document_response.rb +6 -192
  11. data/lib/e_invoice_api/models/document_validate_params.rb +14 -0
  12. data/lib/e_invoice_api/models/documents/ubl_create_from_ubl_params.rb +22 -0
  13. data/lib/e_invoice_api/models/me_retrieve_params.rb +14 -0
  14. data/lib/e_invoice_api/models/me_retrieve_response.rb +149 -0
  15. data/lib/e_invoice_api/models.rb +10 -0
  16. data/lib/e_invoice_api/resources/documents/ubl.rb +22 -0
  17. data/lib/e_invoice_api/resources/documents.rb +52 -0
  18. data/lib/e_invoice_api/resources/me.rb +32 -0
  19. data/lib/e_invoice_api/version.rb +1 -1
  20. data/lib/e_invoice_api.rb +9 -0
  21. data/rbi/e_invoice_api/client.rbi +3 -0
  22. data/rbi/e_invoice_api/models/allowance.rbi +124 -0
  23. data/rbi/e_invoice_api/models/charge.rbi +122 -0
  24. data/rbi/e_invoice_api/models/document_create_from_pdf_params.rbi +56 -0
  25. data/rbi/e_invoice_api/models/document_create_from_pdf_response.rbi +1014 -0
  26. data/rbi/e_invoice_api/models/document_response.rbi +6 -388
  27. data/rbi/e_invoice_api/models/document_validate_params.rbi +30 -0
  28. data/rbi/e_invoice_api/models/documents/ubl_create_from_ubl_params.rbi +43 -0
  29. data/rbi/e_invoice_api/models/me_retrieve_params.rbi +27 -0
  30. data/rbi/e_invoice_api/models/me_retrieve_response.rbi +195 -0
  31. data/rbi/e_invoice_api/models.rbi +10 -0
  32. data/rbi/e_invoice_api/resources/documents/ubl.rbi +10 -0
  33. data/rbi/e_invoice_api/resources/documents.rbi +34 -0
  34. data/rbi/e_invoice_api/resources/me.rbi +21 -0
  35. data/sig/e_invoice_api/client.rbs +2 -0
  36. data/sig/e_invoice_api/models/allowance.rbs +69 -0
  37. data/sig/e_invoice_api/models/charge.rbs +69 -0
  38. data/sig/e_invoice_api/models/document_create_from_pdf_params.rbs +36 -0
  39. data/sig/e_invoice_api/models/document_create_from_pdf_response.rbs +512 -0
  40. data/sig/e_invoice_api/models/document_response.rbs +8 -140
  41. data/sig/e_invoice_api/models/document_validate_params.rbs +15 -0
  42. data/sig/e_invoice_api/models/documents/ubl_create_from_ubl_params.rbs +26 -0
  43. data/sig/e_invoice_api/models/me_retrieve_params.rbs +15 -0
  44. data/sig/e_invoice_api/models/me_retrieve_response.rbs +107 -0
  45. data/sig/e_invoice_api/models.rbs +10 -0
  46. data/sig/e_invoice_api/resources/documents/ubl.rbs +5 -0
  47. data/sig/e_invoice_api/resources/documents.rbs +12 -0
  48. data/sig/e_invoice_api/resources/me.rbs +11 -0
  49. metadata +28 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2717245c8c3aa50544bc2b5b5cc22b3e7df3b1243404356d18b9427c7e8237ab
4
- data.tar.gz: 13158d3d26f6e2a9f70be7fce58ba3c82dc2d3a5d7f0f36e38ba65fab57dd873
3
+ metadata.gz: 6f1662511e2c72c61d378f24d8a9070d1afcfddd24d66a9390cdb9c7455336ab
4
+ data.tar.gz: 87fb923838021213706bbd2d493d8abe7f71e27f3f053b3cda23d397d81518b8
5
5
  SHA512:
6
- metadata.gz: cfb8a54649b656efcb8de955043f0b75161cbe8484f9ac7243dd51212ef307e8e1982b1960988f97ee9d8e4a4b7ae7a5f42b84ac61d0d1a2169265fa653b9e66
7
- data.tar.gz: 63ce2a78bf4f4aa626a0ecea34282074a70340142f87861cb779e7654aaea9a47d4b34edea26fa259da9388ed67f0bf99025467ef3a95b46945948a222ae556a
6
+ metadata.gz: 1d601e5b569985d5f5d1ce3613765f240e9bf30a872ed9b3840c520d7291e1666dc9b94a64b50ae1e4dc61d8cc70f575ccee08cde5304e7641a728e4480193ef
7
+ data.tar.gz: 609338c3438489a7cb3edde8afb93828bb2052a23bf2615d6143770307a451a6916d6e19c6c72866e5c21c9b784e197cc4f66fbedfeeec928d2c55023ce700b1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.0 (2025-10-08)
4
+
5
+ Full Changelog: [v0.7.0...v0.8.0](https://github.com/e-invoice-be/e-invoice-rb/compare/v0.7.0...v0.8.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** manual updates ([ee38fcc](https://github.com/e-invoice-be/e-invoice-rb/commit/ee38fcc6a7ba81d4a3bc3bc1620ae9cca923da3c))
10
+
3
11
  ## 0.7.0 (2025-10-08)
4
12
 
5
13
  Full Changelog: [v0.6.0...v0.7.0](https://github.com/e-invoice-be/e-invoice-rb/compare/v0.6.0...v0.7.0)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "e-invoice-api", "~> 0.7.0"
20
+ gem "e-invoice-api", "~> 0.8.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -73,17 +73,17 @@ Request parameters that correspond to file uploads can be passed as raw contents
73
73
  require "pathname"
74
74
 
75
75
  # Use `Pathname` to send the filename and/or avoid paging a large file into memory:
76
- document_attachment = e_invoice.documents.attachments.add(file: Pathname("/path/to/file"))
76
+ response = e_invoice.documents.create_from_pdf(file: Pathname("/path/to/file"))
77
77
 
78
78
  # Alternatively, pass file contents or a `StringIO` directly:
79
- document_attachment = e_invoice.documents.attachments.add(file: File.read("/path/to/file"))
79
+ response = e_invoice.documents.create_from_pdf(file: File.read("/path/to/file"))
80
80
 
81
81
  # Or, to control the filename and/or content type:
82
82
  file =
83
83
  EInvoiceAPI::FilePart.new(File.read("/path/to/file"), filename: "/path/to/file", content_type: "…")
84
- document_attachment = e_invoice.documents.attachments.add(file: file)
84
+ response = e_invoice.documents.create_from_pdf(file: file)
85
85
 
86
- puts(document_attachment.id)
86
+ puts(response.customer_id)
87
87
  ```
88
88
 
89
89
  Note that you can also pass a raw `IO` descriptor, but this disables retries, as the library can't be sure if the descriptor is a file or pipe (which cannot be rewound).
@@ -33,6 +33,9 @@ module EInvoiceAPI
33
33
  # @return [EInvoiceAPI::Resources::Lookup]
34
34
  attr_reader :lookup
35
35
 
36
+ # @return [EInvoiceAPI::Resources::Me]
37
+ attr_reader :me
38
+
36
39
  # @return [EInvoiceAPI::Resources::Webhooks]
37
40
  attr_reader :webhooks
38
41
 
@@ -88,6 +91,7 @@ module EInvoiceAPI
88
91
  @outbox = EInvoiceAPI::Resources::Outbox.new(client: self)
89
92
  @validate = EInvoiceAPI::Resources::Validate.new(client: self)
90
93
  @lookup = EInvoiceAPI::Resources::Lookup.new(client: self)
94
+ @me = EInvoiceAPI::Resources::Me.new(client: self)
91
95
  @webhooks = EInvoiceAPI::Resources::Webhooks.new(client: self)
92
96
  end
93
97
  end
@@ -438,11 +438,11 @@ module EInvoiceAPI
438
438
  # @return [Hash{Symbol=>Object}]
439
439
  #
440
440
  # @example
441
- # # `document_attachment_create` is a `EInvoiceAPI::DocumentAttachmentCreate`
442
- # document_attachment_create => {
443
- # file_name: file_name,
444
- # file_data: file_data,
445
- # file_size: file_size
441
+ # # `allowance` is a `EInvoiceAPI::Allowance`
442
+ # allowance => {
443
+ # amount: amount,
444
+ # base_amount: base_amount,
445
+ # multiplier_factor: multiplier_factor
446
446
  # }
447
447
  def deconstruct_keys(keys)
448
448
  (keys || self.class.known_fields.keys)
@@ -0,0 +1,96 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ class Allowance < EInvoiceAPI::Internal::Type::BaseModel
6
+ # @!attribute amount
7
+ # The allowance amount, without VAT. Must be rounded to maximum 2 decimals
8
+ #
9
+ # @return [String, nil]
10
+ optional :amount, String, nil?: true
11
+
12
+ # @!attribute base_amount
13
+ # The base amount that may be used, in conjunction with the allowance percentage,
14
+ # to calculate the allowance amount. Must be rounded to maximum 2 decimals
15
+ #
16
+ # @return [String, nil]
17
+ optional :base_amount, String, nil?: true
18
+
19
+ # @!attribute multiplier_factor
20
+ # The percentage that may be used, in conjunction with the allowance base amount,
21
+ # to calculate the allowance amount. To state 20%, use value 20
22
+ #
23
+ # @return [String, nil]
24
+ optional :multiplier_factor, String, nil?: true
25
+
26
+ # @!attribute reason
27
+ # The reason for the allowance
28
+ #
29
+ # @return [String, nil]
30
+ optional :reason, String, nil?: true
31
+
32
+ # @!attribute reason_code
33
+ # The code for the allowance reason
34
+ #
35
+ # @return [String, nil]
36
+ optional :reason_code, String, nil?: true
37
+
38
+ # @!attribute tax_code
39
+ # Duty or tax or fee category codes (Subset of UNCL5305)
40
+ #
41
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
42
+ #
43
+ # @return [Symbol, EInvoiceAPI::Models::Allowance::TaxCode, nil]
44
+ optional :tax_code, enum: -> { EInvoiceAPI::Allowance::TaxCode }, nil?: true
45
+
46
+ # @!attribute tax_rate
47
+ # The VAT rate, represented as percentage that applies to the allowance
48
+ #
49
+ # @return [String, nil]
50
+ optional :tax_rate, String, nil?: true
51
+
52
+ # @!method initialize(amount: nil, base_amount: nil, multiplier_factor: nil, reason: nil, reason_code: nil, tax_code: nil, tax_rate: nil)
53
+ # Some parameter documentations has been truncated, see
54
+ # {EInvoiceAPI::Models::Allowance} for more details.
55
+ #
56
+ # An allowance is a discount for example for early payment, volume discount, etc.
57
+ #
58
+ # @param amount [String, nil] The allowance amount, without VAT. Must be rounded to maximum 2 decimals
59
+ #
60
+ # @param base_amount [String, nil] The base amount that may be used, in conjunction with the allowance percentage,
61
+ #
62
+ # @param multiplier_factor [String, nil] The percentage that may be used, in conjunction with the allowance base amount,
63
+ #
64
+ # @param reason [String, nil] The reason for the allowance
65
+ #
66
+ # @param reason_code [String, nil] The code for the allowance reason
67
+ #
68
+ # @param tax_code [Symbol, EInvoiceAPI::Models::Allowance::TaxCode, nil] Duty or tax or fee category codes (Subset of UNCL5305)
69
+ #
70
+ # @param tax_rate [String, nil] The VAT rate, represented as percentage that applies to the allowance
71
+
72
+ # Duty or tax or fee category codes (Subset of UNCL5305)
73
+ #
74
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
75
+ #
76
+ # @see EInvoiceAPI::Models::Allowance#tax_code
77
+ module TaxCode
78
+ extend EInvoiceAPI::Internal::Type::Enum
79
+
80
+ AE = :AE
81
+ E = :E
82
+ S = :S
83
+ Z = :Z
84
+ G = :G
85
+ O = :O
86
+ K = :K
87
+ L = :L
88
+ M = :M
89
+ B = :B
90
+
91
+ # @!method self.values
92
+ # @return [Array<Symbol>]
93
+ end
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,96 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ class Charge < EInvoiceAPI::Internal::Type::BaseModel
6
+ # @!attribute amount
7
+ # The charge amount, without VAT. Must be rounded to maximum 2 decimals
8
+ #
9
+ # @return [String, nil]
10
+ optional :amount, String, nil?: true
11
+
12
+ # @!attribute base_amount
13
+ # The base amount that may be used, in conjunction with the charge percentage, to
14
+ # calculate the charge amount. Must be rounded to maximum 2 decimals
15
+ #
16
+ # @return [String, nil]
17
+ optional :base_amount, String, nil?: true
18
+
19
+ # @!attribute multiplier_factor
20
+ # The percentage that may be used, in conjunction with the charge base amount, to
21
+ # calculate the charge amount. To state 20%, use value 20
22
+ #
23
+ # @return [String, nil]
24
+ optional :multiplier_factor, String, nil?: true
25
+
26
+ # @!attribute reason
27
+ # The reason for the charge
28
+ #
29
+ # @return [String, nil]
30
+ optional :reason, String, nil?: true
31
+
32
+ # @!attribute reason_code
33
+ # The code for the charge reason
34
+ #
35
+ # @return [String, nil]
36
+ optional :reason_code, String, nil?: true
37
+
38
+ # @!attribute tax_code
39
+ # Duty or tax or fee category codes (Subset of UNCL5305)
40
+ #
41
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
42
+ #
43
+ # @return [Symbol, EInvoiceAPI::Models::Charge::TaxCode, nil]
44
+ optional :tax_code, enum: -> { EInvoiceAPI::Charge::TaxCode }, nil?: true
45
+
46
+ # @!attribute tax_rate
47
+ # The VAT rate, represented as percentage that applies to the charge
48
+ #
49
+ # @return [String, nil]
50
+ optional :tax_rate, String, nil?: true
51
+
52
+ # @!method initialize(amount: nil, base_amount: nil, multiplier_factor: nil, reason: nil, reason_code: nil, tax_code: nil, tax_rate: nil)
53
+ # Some parameter documentations has been truncated, see
54
+ # {EInvoiceAPI::Models::Charge} for more details.
55
+ #
56
+ # A charge is an additional fee for example for late payment, late delivery, etc.
57
+ #
58
+ # @param amount [String, nil] The charge amount, without VAT. Must be rounded to maximum 2 decimals
59
+ #
60
+ # @param base_amount [String, nil] The base amount that may be used, in conjunction with the charge percentage, to
61
+ #
62
+ # @param multiplier_factor [String, nil] The percentage that may be used, in conjunction with the charge base amount, to
63
+ #
64
+ # @param reason [String, nil] The reason for the charge
65
+ #
66
+ # @param reason_code [String, nil] The code for the charge reason
67
+ #
68
+ # @param tax_code [Symbol, EInvoiceAPI::Models::Charge::TaxCode, nil] Duty or tax or fee category codes (Subset of UNCL5305)
69
+ #
70
+ # @param tax_rate [String, nil] The VAT rate, represented as percentage that applies to the charge
71
+
72
+ # Duty or tax or fee category codes (Subset of UNCL5305)
73
+ #
74
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
75
+ #
76
+ # @see EInvoiceAPI::Models::Charge#tax_code
77
+ module TaxCode
78
+ extend EInvoiceAPI::Internal::Type::Enum
79
+
80
+ AE = :AE
81
+ E = :E
82
+ S = :S
83
+ Z = :Z
84
+ G = :G
85
+ O = :O
86
+ K = :K
87
+ L = :L
88
+ M = :M
89
+ B = :B
90
+
91
+ # @!method self.values
92
+ # @return [Array<Symbol>]
93
+ end
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ # @see EInvoiceAPI::Resources::Documents#create_from_pdf
6
+ class DocumentCreateFromPdfParams < EInvoiceAPI::Internal::Type::BaseModel
7
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
8
+ include EInvoiceAPI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute file
11
+ #
12
+ # @return [Pathname, StringIO, IO, String, EInvoiceAPI::FilePart]
13
+ required :file, EInvoiceAPI::Internal::Type::FileInput
14
+
15
+ # @!attribute customer_tax_id
16
+ #
17
+ # @return [String, nil]
18
+ optional :customer_tax_id, String, nil?: true
19
+
20
+ # @!attribute vendor_tax_id
21
+ #
22
+ # @return [String, nil]
23
+ optional :vendor_tax_id, String, nil?: true
24
+
25
+ # @!method initialize(file:, customer_tax_id: nil, vendor_tax_id: nil, request_options: {})
26
+ # @param file [Pathname, StringIO, IO, String, EInvoiceAPI::FilePart]
27
+ # @param customer_tax_id [String, nil]
28
+ # @param vendor_tax_id [String, nil]
29
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}]
30
+ end
31
+ end
32
+ end