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
@@ -0,0 +1,124 @@
1
+ # typed: strong
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ class Allowance < EInvoiceAPI::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(EInvoiceAPI::Allowance, EInvoiceAPI::Internal::AnyHash)
9
+ end
10
+
11
+ # The allowance amount, without VAT. Must be rounded to maximum 2 decimals
12
+ sig { returns(T.nilable(String)) }
13
+ attr_accessor :amount
14
+
15
+ # The base amount that may be used, in conjunction with the allowance percentage,
16
+ # to calculate the allowance amount. Must be rounded to maximum 2 decimals
17
+ sig { returns(T.nilable(String)) }
18
+ attr_accessor :base_amount
19
+
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
+ sig { returns(T.nilable(String)) }
23
+ attr_accessor :multiplier_factor
24
+
25
+ # The reason for the allowance
26
+ sig { returns(T.nilable(String)) }
27
+ attr_accessor :reason
28
+
29
+ # The code for the allowance reason
30
+ sig { returns(T.nilable(String)) }
31
+ attr_accessor :reason_code
32
+
33
+ # Duty or tax or fee category codes (Subset of UNCL5305)
34
+ #
35
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
36
+ sig { returns(T.nilable(EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)) }
37
+ attr_accessor :tax_code
38
+
39
+ # The VAT rate, represented as percentage that applies to the allowance
40
+ sig { returns(T.nilable(String)) }
41
+ attr_accessor :tax_rate
42
+
43
+ # An allowance is a discount for example for early payment, volume discount, etc.
44
+ sig do
45
+ params(
46
+ amount: T.nilable(String),
47
+ base_amount: T.nilable(String),
48
+ multiplier_factor: T.nilable(String),
49
+ reason: T.nilable(String),
50
+ reason_code: T.nilable(String),
51
+ tax_code: T.nilable(EInvoiceAPI::Allowance::TaxCode::OrSymbol),
52
+ tax_rate: T.nilable(String)
53
+ ).returns(T.attached_class)
54
+ end
55
+ def self.new(
56
+ # The allowance amount, without VAT. Must be rounded to maximum 2 decimals
57
+ amount: nil,
58
+ # The base amount that may be used, in conjunction with the allowance percentage,
59
+ # to calculate the allowance amount. Must be rounded to maximum 2 decimals
60
+ base_amount: nil,
61
+ # The percentage that may be used, in conjunction with the allowance base amount,
62
+ # to calculate the allowance amount. To state 20%, use value 20
63
+ multiplier_factor: nil,
64
+ # The reason for the allowance
65
+ reason: nil,
66
+ # The code for the allowance reason
67
+ reason_code: nil,
68
+ # Duty or tax or fee category codes (Subset of UNCL5305)
69
+ #
70
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
71
+ tax_code: nil,
72
+ # The VAT rate, represented as percentage that applies to the allowance
73
+ tax_rate: nil
74
+ )
75
+ end
76
+
77
+ sig do
78
+ override.returns(
79
+ {
80
+ amount: T.nilable(String),
81
+ base_amount: T.nilable(String),
82
+ multiplier_factor: T.nilable(String),
83
+ reason: T.nilable(String),
84
+ reason_code: T.nilable(String),
85
+ tax_code: T.nilable(EInvoiceAPI::Allowance::TaxCode::TaggedSymbol),
86
+ tax_rate: T.nilable(String)
87
+ }
88
+ )
89
+ end
90
+ def to_hash
91
+ end
92
+
93
+ # Duty or tax or fee category codes (Subset of UNCL5305)
94
+ #
95
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
96
+ module TaxCode
97
+ extend EInvoiceAPI::Internal::Type::Enum
98
+
99
+ TaggedSymbol =
100
+ T.type_alias { T.all(Symbol, EInvoiceAPI::Allowance::TaxCode) }
101
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
102
+
103
+ AE = T.let(:AE, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
104
+ E = T.let(:E, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
105
+ S = T.let(:S, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
106
+ Z = T.let(:Z, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
107
+ G = T.let(:G, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
108
+ O = T.let(:O, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
109
+ K = T.let(:K, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
110
+ L = T.let(:L, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
111
+ M = T.let(:M, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
112
+ B = T.let(:B, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
113
+
114
+ sig do
115
+ override.returns(
116
+ T::Array[EInvoiceAPI::Allowance::TaxCode::TaggedSymbol]
117
+ )
118
+ end
119
+ def self.values
120
+ end
121
+ end
122
+ end
123
+ end
124
+ end
@@ -0,0 +1,122 @@
1
+ # typed: strong
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ class Charge < EInvoiceAPI::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(EInvoiceAPI::Charge, EInvoiceAPI::Internal::AnyHash)
9
+ end
10
+
11
+ # The charge amount, without VAT. Must be rounded to maximum 2 decimals
12
+ sig { returns(T.nilable(String)) }
13
+ attr_accessor :amount
14
+
15
+ # The base amount that may be used, in conjunction with the charge percentage, to
16
+ # calculate the charge amount. Must be rounded to maximum 2 decimals
17
+ sig { returns(T.nilable(String)) }
18
+ attr_accessor :base_amount
19
+
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
+ sig { returns(T.nilable(String)) }
23
+ attr_accessor :multiplier_factor
24
+
25
+ # The reason for the charge
26
+ sig { returns(T.nilable(String)) }
27
+ attr_accessor :reason
28
+
29
+ # The code for the charge reason
30
+ sig { returns(T.nilable(String)) }
31
+ attr_accessor :reason_code
32
+
33
+ # Duty or tax or fee category codes (Subset of UNCL5305)
34
+ #
35
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
36
+ sig { returns(T.nilable(EInvoiceAPI::Charge::TaxCode::TaggedSymbol)) }
37
+ attr_accessor :tax_code
38
+
39
+ # The VAT rate, represented as percentage that applies to the charge
40
+ sig { returns(T.nilable(String)) }
41
+ attr_accessor :tax_rate
42
+
43
+ # A charge is an additional fee for example for late payment, late delivery, etc.
44
+ sig do
45
+ params(
46
+ amount: T.nilable(String),
47
+ base_amount: T.nilable(String),
48
+ multiplier_factor: T.nilable(String),
49
+ reason: T.nilable(String),
50
+ reason_code: T.nilable(String),
51
+ tax_code: T.nilable(EInvoiceAPI::Charge::TaxCode::OrSymbol),
52
+ tax_rate: T.nilable(String)
53
+ ).returns(T.attached_class)
54
+ end
55
+ def self.new(
56
+ # The charge amount, without VAT. Must be rounded to maximum 2 decimals
57
+ amount: nil,
58
+ # The base amount that may be used, in conjunction with the charge percentage, to
59
+ # calculate the charge amount. Must be rounded to maximum 2 decimals
60
+ base_amount: nil,
61
+ # The percentage that may be used, in conjunction with the charge base amount, to
62
+ # calculate the charge amount. To state 20%, use value 20
63
+ multiplier_factor: nil,
64
+ # The reason for the charge
65
+ reason: nil,
66
+ # The code for the charge reason
67
+ reason_code: nil,
68
+ # Duty or tax or fee category codes (Subset of UNCL5305)
69
+ #
70
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
71
+ tax_code: nil,
72
+ # The VAT rate, represented as percentage that applies to the charge
73
+ tax_rate: nil
74
+ )
75
+ end
76
+
77
+ sig do
78
+ override.returns(
79
+ {
80
+ amount: T.nilable(String),
81
+ base_amount: T.nilable(String),
82
+ multiplier_factor: T.nilable(String),
83
+ reason: T.nilable(String),
84
+ reason_code: T.nilable(String),
85
+ tax_code: T.nilable(EInvoiceAPI::Charge::TaxCode::TaggedSymbol),
86
+ tax_rate: T.nilable(String)
87
+ }
88
+ )
89
+ end
90
+ def to_hash
91
+ end
92
+
93
+ # Duty or tax or fee category codes (Subset of UNCL5305)
94
+ #
95
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
96
+ module TaxCode
97
+ extend EInvoiceAPI::Internal::Type::Enum
98
+
99
+ TaggedSymbol =
100
+ T.type_alias { T.all(Symbol, EInvoiceAPI::Charge::TaxCode) }
101
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
102
+
103
+ AE = T.let(:AE, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
104
+ E = T.let(:E, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
105
+ S = T.let(:S, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
106
+ Z = T.let(:Z, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
107
+ G = T.let(:G, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
108
+ O = T.let(:O, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
109
+ K = T.let(:K, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
110
+ L = T.let(:L, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
111
+ M = T.let(:M, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
112
+ B = T.let(:B, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
113
+
114
+ sig do
115
+ override.returns(T::Array[EInvoiceAPI::Charge::TaxCode::TaggedSymbol])
116
+ end
117
+ def self.values
118
+ end
119
+ end
120
+ end
121
+ end
122
+ end
@@ -0,0 +1,56 @@
1
+ # typed: strong
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ class DocumentCreateFromPdfParams < EInvoiceAPI::Internal::Type::BaseModel
6
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
7
+ include EInvoiceAPI::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ EInvoiceAPI::DocumentCreateFromPdfParams,
13
+ EInvoiceAPI::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig { returns(EInvoiceAPI::Internal::FileInput) }
18
+ attr_accessor :file
19
+
20
+ sig { returns(T.nilable(String)) }
21
+ attr_accessor :customer_tax_id
22
+
23
+ sig { returns(T.nilable(String)) }
24
+ attr_accessor :vendor_tax_id
25
+
26
+ sig do
27
+ params(
28
+ file: EInvoiceAPI::Internal::FileInput,
29
+ customer_tax_id: T.nilable(String),
30
+ vendor_tax_id: T.nilable(String),
31
+ request_options: EInvoiceAPI::RequestOptions::OrHash
32
+ ).returns(T.attached_class)
33
+ end
34
+ def self.new(
35
+ file:,
36
+ customer_tax_id: nil,
37
+ vendor_tax_id: nil,
38
+ request_options: {}
39
+ )
40
+ end
41
+
42
+ sig do
43
+ override.returns(
44
+ {
45
+ file: EInvoiceAPI::Internal::FileInput,
46
+ customer_tax_id: T.nilable(String),
47
+ vendor_tax_id: T.nilable(String),
48
+ request_options: EInvoiceAPI::RequestOptions
49
+ }
50
+ )
51
+ end
52
+ def to_hash
53
+ end
54
+ end
55
+ end
56
+ end