factpulse 3.0.36 → 4.0.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -13
- data/Gemfile.lock +1 -1
- data/README.md +136 -138
- data/docs/FactureElectroniqueModelsInvoiceTypeCode.md +15 -0
- data/docs/InvoiceInput.md +1 -1
- data/docs/Recipient.md +1 -1
- data/docs/SimplifiedInvoiceData.md +1 -1
- data/docs/SubmitCompleteInvoiceResponse.md +2 -2
- data/docs/Supplier.md +1 -1
- data/lib/factpulse/helpers/client.rb +152 -770
- data/lib/factpulse/helpers/exceptions.rb +38 -14
- data/lib/factpulse/helpers/helpers.rb +8 -7
- data/lib/factpulse/models/{facture_electronique_rest_api_schemas_ereporting_invoice_type_code.rb → facture_electronique_models_invoice_type_code.rb} +20 -9
- data/lib/factpulse/models/invoice_input.rb +1 -1
- data/lib/factpulse/models/invoice_type_code.rb +6 -17
- data/lib/factpulse/models/recipient.rb +0 -2
- data/lib/factpulse/models/scheme_id.rb +3 -3
- data/lib/factpulse/models/simplified_invoice_data.rb +1 -1
- data/lib/factpulse/models/submit_complete_invoice_response.rb +16 -16
- data/lib/factpulse/models/supplier.rb +0 -2
- data/lib/factpulse/version.rb +1 -1
- data/lib/factpulse.rb +1 -1
- metadata +4 -4
- data/docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md +0 -15
|
@@ -1,21 +1,45 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
module FactPulse
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
# Additional error types (base Error class is in client.rb)
|
|
5
|
+
class AuthError < Error; end
|
|
6
|
+
|
|
7
|
+
class PollingTimeout < Error
|
|
8
|
+
attr_reader :task_id, :timeout
|
|
9
|
+
|
|
10
|
+
def initialize(task_id, timeout)
|
|
11
|
+
@task_id = task_id
|
|
12
|
+
@timeout = timeout
|
|
13
|
+
super("Timeout (#{timeout}ms) for #{task_id}")
|
|
9
14
|
end
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
class ValidationErrorDetail
|
|
18
|
+
attr_accessor :level, :item, :reason, :source, :code
|
|
19
|
+
|
|
20
|
+
def initialize(level: '', item: '', reason: '', source: nil, code: nil)
|
|
21
|
+
@level = level
|
|
22
|
+
@item = item
|
|
23
|
+
@reason = reason
|
|
24
|
+
@source = source
|
|
25
|
+
@code = code
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def to_s
|
|
29
|
+
"[#{@item.to_s.empty? ? 'unknown' : @item}] #{@reason.to_s.empty? ? 'Unknown error' : @reason}"
|
|
15
30
|
end
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
31
|
+
|
|
32
|
+
def self.from_hash(h)
|
|
33
|
+
new(level: h['level'] || '', item: h['item'] || '', reason: h['reason'] || '', source: h['source'], code: h['code'])
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
class ValidationError < Error
|
|
38
|
+
attr_reader :errors
|
|
39
|
+
|
|
40
|
+
def initialize(msg, errors = [])
|
|
41
|
+
@errors = errors
|
|
42
|
+
super(errors.empty? ? msg : "#{msg}\n\nDetails:\n#{errors.map { |e| " - #{e}" }.join("\n")}")
|
|
19
43
|
end
|
|
20
44
|
end
|
|
21
45
|
end
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
# Load client first (defines FactPulse::Error base class)
|
|
3
4
|
require_relative 'client'
|
|
5
|
+
# Then load additional exception types
|
|
6
|
+
require_relative 'exceptions'
|
|
7
|
+
|
|
4
8
|
module FactPulse
|
|
5
9
|
module Helpers
|
|
6
|
-
def self.create_client(**opts)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def self.invoice_totals(*args, **kwargs); AmountHelpers.invoice_totals(*args, **kwargs); end
|
|
10
|
-
def self.invoice_line(*args, **kwargs); AmountHelpers.invoice_line(*args, **kwargs); end
|
|
11
|
-
def self.vat_line(*args, **kwargs); AmountHelpers.vat_line(*args, **kwargs); end
|
|
10
|
+
def self.create_client(**opts)
|
|
11
|
+
FactPulse::Client.new(**opts)
|
|
12
|
+
end
|
|
12
13
|
end
|
|
13
14
|
end
|
|
@@ -14,15 +14,26 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
|
-
class
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
class FactureElectroniqueModelsInvoiceTypeCode
|
|
18
|
+
INVOICE = "380".freeze
|
|
19
|
+
SELF_BILLED_INVOICE = "389".freeze
|
|
20
|
+
FACTORED_INVOICE = "393".freeze
|
|
21
|
+
SELF_BILLED_FACTORED_INVOICE = "501".freeze
|
|
22
|
+
PREPAYMENT_INVOICE = "386".freeze
|
|
23
|
+
SELF_BILLED_PREPAYMENT_INVOICE = "500".freeze
|
|
24
|
+
CORRECTIVE_INVOICE = "384".freeze
|
|
25
|
+
SELF_BILLED_CORRECTIVE_INVOICE = "471".freeze
|
|
26
|
+
FACTORED_CORRECTIVE_INVOICE = "472".freeze
|
|
27
|
+
SELF_BILLED_FACTORED_CORRECTIVE_INVOICE = "473".freeze
|
|
28
|
+
CREDIT_NOTE = "381".freeze
|
|
29
|
+
SELF_BILLED_CREDIT_NOTE = "261".freeze
|
|
30
|
+
GLOBAL_ALLOWANCE_CREDIT_NOTE = "262".freeze
|
|
31
|
+
FACTORED_CREDIT_NOTE = "396".freeze
|
|
32
|
+
SELF_BILLED_FACTORED_CREDIT_NOTE = "502".freeze
|
|
33
|
+
PREPAYMENT_CREDIT_NOTE = "503".freeze
|
|
23
34
|
|
|
24
35
|
def self.all_vars
|
|
25
|
-
@all_vars ||= [
|
|
36
|
+
@all_vars ||= [INVOICE, SELF_BILLED_INVOICE, FACTORED_INVOICE, SELF_BILLED_FACTORED_INVOICE, PREPAYMENT_INVOICE, SELF_BILLED_PREPAYMENT_INVOICE, CORRECTIVE_INVOICE, SELF_BILLED_CORRECTIVE_INVOICE, FACTORED_CORRECTIVE_INVOICE, SELF_BILLED_FACTORED_CORRECTIVE_INVOICE, CREDIT_NOTE, SELF_BILLED_CREDIT_NOTE, GLOBAL_ALLOWANCE_CREDIT_NOTE, FACTORED_CREDIT_NOTE, SELF_BILLED_FACTORED_CREDIT_NOTE, PREPAYMENT_CREDIT_NOTE].freeze
|
|
26
37
|
end
|
|
27
38
|
|
|
28
39
|
# Builds the enum from string
|
|
@@ -36,8 +47,8 @@ module FactPulse
|
|
|
36
47
|
# @param [String] The enum value in the form of the string
|
|
37
48
|
# @return [String] The enum value
|
|
38
49
|
def build_from_hash(value)
|
|
39
|
-
return value if
|
|
40
|
-
raise "Invalid ENUM value #{value} for class #
|
|
50
|
+
return value if FactureElectroniqueModelsInvoiceTypeCode.all_vars.include?(value)
|
|
51
|
+
raise "Invalid ENUM value #{value} for class #FactureElectroniqueModelsInvoiceTypeCode"
|
|
41
52
|
end
|
|
42
53
|
end
|
|
43
54
|
end
|
|
@@ -112,7 +112,7 @@ module FactPulse
|
|
|
112
112
|
{
|
|
113
113
|
:'invoice_id' => :'String',
|
|
114
114
|
:'issue_date' => :'Date',
|
|
115
|
-
:'type_code' => :'
|
|
115
|
+
:'type_code' => :'InvoiceTypeCode',
|
|
116
116
|
:'currency' => :'Currency',
|
|
117
117
|
:'due_date' => :'Date',
|
|
118
118
|
:'seller_siren' => :'String',
|
|
@@ -15,25 +15,14 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
17
|
class InvoiceTypeCode
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
SELF_BILLED_PREPAYMENT_INVOICE = "500".freeze
|
|
24
|
-
CORRECTIVE_INVOICE = "384".freeze
|
|
25
|
-
SELF_BILLED_CORRECTIVE_INVOICE = "471".freeze
|
|
26
|
-
FACTORED_CORRECTIVE_INVOICE = "472".freeze
|
|
27
|
-
SELF_BILLED_FACTORED_CORRECTIVE_INVOICE = "473".freeze
|
|
28
|
-
CREDIT_NOTE = "381".freeze
|
|
29
|
-
SELF_BILLED_CREDIT_NOTE = "261".freeze
|
|
30
|
-
GLOBAL_ALLOWANCE_CREDIT_NOTE = "262".freeze
|
|
31
|
-
FACTORED_CREDIT_NOTE = "396".freeze
|
|
32
|
-
SELF_BILLED_FACTORED_CREDIT_NOTE = "502".freeze
|
|
33
|
-
PREPAYMENT_CREDIT_NOTE = "503".freeze
|
|
18
|
+
N380 = "380".freeze
|
|
19
|
+
N381 = "381".freeze
|
|
20
|
+
N384 = "384".freeze
|
|
21
|
+
N389 = "389".freeze
|
|
22
|
+
N386 = "386".freeze
|
|
34
23
|
|
|
35
24
|
def self.all_vars
|
|
36
|
-
@all_vars ||= [
|
|
25
|
+
@all_vars ||= [N380, N381, N384, N389, N386].freeze
|
|
37
26
|
end
|
|
38
27
|
|
|
39
28
|
# Builds the enum from string
|
|
@@ -15,9 +15,9 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
17
|
class SchemeID
|
|
18
|
-
|
|
18
|
+
FR_ELECTRONIC_ADDRESS = "0225".freeze
|
|
19
|
+
FR_SIREN = "0002".freeze
|
|
19
20
|
FR_SIRET = "0009".freeze
|
|
20
|
-
FR_SIREN_OLD = "0002".freeze
|
|
21
21
|
GLN = "0088".freeze
|
|
22
22
|
DUNS = "0060".freeze
|
|
23
23
|
FR_VAT_INTRA = "9957".freeze
|
|
@@ -35,7 +35,7 @@ module FactPulse
|
|
|
35
35
|
PT_VAT = "9934".freeze
|
|
36
36
|
|
|
37
37
|
def self.all_vars
|
|
38
|
-
@all_vars ||= [FR_SIREN, FR_SIRET,
|
|
38
|
+
@all_vars ||= [FR_ELECTRONIC_ADDRESS, FR_SIREN, FR_SIRET, GLN, DUNS, FR_VAT_INTRA, GLEIF, DT_DIRECTORY_ID, EMAIL, ODETTE, FR_CHORUS_PRO_ROUTING, DE_VAT, AT_VAT, BE_VAT, ES_VAT, IT_VAT, NL_VAT, PT_VAT].freeze
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
# Builds the enum from string
|
|
@@ -111,7 +111,7 @@ module FactPulse
|
|
|
111
111
|
:'comment' => :'String',
|
|
112
112
|
:'purchase_order_reference' => :'String',
|
|
113
113
|
:'contract_reference' => :'String',
|
|
114
|
-
:'invoice_type' => :'
|
|
114
|
+
:'invoice_type' => :'FactureElectroniqueModelsInvoiceTypeCode',
|
|
115
115
|
:'preceding_invoice_reference' => :'String',
|
|
116
116
|
:'operation_nature' => :'OperationNature',
|
|
117
117
|
:'invoicing_framework' => :'InvoicingFrameworkCode'
|
|
@@ -35,7 +35,7 @@ module FactPulse
|
|
|
35
35
|
attr_accessor :signature
|
|
36
36
|
|
|
37
37
|
# Generated Factur-X PDF (and signed if requested) base64-encoded
|
|
38
|
-
attr_accessor :
|
|
38
|
+
attr_accessor :content_b64
|
|
39
39
|
|
|
40
40
|
# Return message
|
|
41
41
|
attr_accessor :message
|
|
@@ -72,7 +72,7 @@ module FactPulse
|
|
|
72
72
|
:'enriched_invoice' => :'enrichedInvoice',
|
|
73
73
|
:'facturx_pdf' => :'facturxPdf',
|
|
74
74
|
:'signature' => :'signature',
|
|
75
|
-
:'
|
|
75
|
+
:'content_b64' => :'contentB64',
|
|
76
76
|
:'message' => :'message'
|
|
77
77
|
}
|
|
78
78
|
end
|
|
@@ -97,7 +97,7 @@ module FactPulse
|
|
|
97
97
|
:'enriched_invoice' => :'EnrichedInvoiceInfo',
|
|
98
98
|
:'facturx_pdf' => :'FacturXPDFInfo',
|
|
99
99
|
:'signature' => :'SignatureInfo',
|
|
100
|
-
:'
|
|
100
|
+
:'content_b64' => :'String',
|
|
101
101
|
:'message' => :'String'
|
|
102
102
|
}
|
|
103
103
|
end
|
|
@@ -163,10 +163,10 @@ module FactPulse
|
|
|
163
163
|
self.signature = attributes[:'signature']
|
|
164
164
|
end
|
|
165
165
|
|
|
166
|
-
if attributes.key?(:'
|
|
167
|
-
self.
|
|
166
|
+
if attributes.key?(:'content_b64')
|
|
167
|
+
self.content_b64 = attributes[:'content_b64']
|
|
168
168
|
else
|
|
169
|
-
self.
|
|
169
|
+
self.content_b64 = nil
|
|
170
170
|
end
|
|
171
171
|
|
|
172
172
|
if attributes.key?(:'message')
|
|
@@ -197,8 +197,8 @@ module FactPulse
|
|
|
197
197
|
invalid_properties.push('invalid value for "facturx_pdf", facturx_pdf cannot be nil.')
|
|
198
198
|
end
|
|
199
199
|
|
|
200
|
-
if @
|
|
201
|
-
invalid_properties.push('invalid value for "
|
|
200
|
+
if @content_b64.nil?
|
|
201
|
+
invalid_properties.push('invalid value for "content_b64", content_b64 cannot be nil.')
|
|
202
202
|
end
|
|
203
203
|
|
|
204
204
|
if @message.nil?
|
|
@@ -218,7 +218,7 @@ module FactPulse
|
|
|
218
218
|
return false unless destination_type_validator.valid?(@destination_type)
|
|
219
219
|
return false if @enriched_invoice.nil?
|
|
220
220
|
return false if @facturx_pdf.nil?
|
|
221
|
-
return false if @
|
|
221
|
+
return false if @content_b64.nil?
|
|
222
222
|
return false if @message.nil?
|
|
223
223
|
true
|
|
224
224
|
end
|
|
@@ -264,13 +264,13 @@ module FactPulse
|
|
|
264
264
|
end
|
|
265
265
|
|
|
266
266
|
# Custom attribute writer method with validation
|
|
267
|
-
# @param [Object]
|
|
268
|
-
def
|
|
269
|
-
if
|
|
270
|
-
fail ArgumentError, '
|
|
267
|
+
# @param [Object] content_b64 Value to be assigned
|
|
268
|
+
def content_b64=(content_b64)
|
|
269
|
+
if content_b64.nil?
|
|
270
|
+
fail ArgumentError, 'content_b64 cannot be nil'
|
|
271
271
|
end
|
|
272
272
|
|
|
273
|
-
@
|
|
273
|
+
@content_b64 = content_b64
|
|
274
274
|
end
|
|
275
275
|
|
|
276
276
|
# Custom attribute writer method with validation
|
|
@@ -295,7 +295,7 @@ module FactPulse
|
|
|
295
295
|
enriched_invoice == o.enriched_invoice &&
|
|
296
296
|
facturx_pdf == o.facturx_pdf &&
|
|
297
297
|
signature == o.signature &&
|
|
298
|
-
|
|
298
|
+
content_b64 == o.content_b64 &&
|
|
299
299
|
message == o.message
|
|
300
300
|
end
|
|
301
301
|
|
|
@@ -308,7 +308,7 @@ module FactPulse
|
|
|
308
308
|
# Calculates hash code according to all attributes.
|
|
309
309
|
# @return [Integer] Hash code
|
|
310
310
|
def hash
|
|
311
|
-
[success, destination_type, chorus_result, afnor_result, enriched_invoice, facturx_pdf, signature,
|
|
311
|
+
[success, destination_type, chorus_result, afnor_result, enriched_invoice, facturx_pdf, signature, content_b64, message].hash
|
|
312
312
|
end
|
|
313
313
|
|
|
314
314
|
# Builds the object from hash
|
data/lib/factpulse/version.rb
CHANGED
data/lib/factpulse.rb
CHANGED
|
@@ -165,8 +165,8 @@ require 'factpulse/models/error_source'
|
|
|
165
165
|
require 'factpulse/models/extraction_info'
|
|
166
166
|
require 'factpulse/models/factur_x_invoice'
|
|
167
167
|
require 'factpulse/models/factur_xpdf_info'
|
|
168
|
+
require 'factpulse/models/facture_electronique_models_invoice_type_code'
|
|
168
169
|
require 'factpulse/models/facture_electronique_rest_api_schemas_cdar_validation_error_response'
|
|
169
|
-
require 'factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code'
|
|
170
170
|
require 'factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials'
|
|
171
171
|
require 'factpulse/models/field_status'
|
|
172
172
|
require 'factpulse/models/file_info'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: factpulse
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenAPI-Generator
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-01-
|
|
11
|
+
date: 2026-01-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: typhoeus
|
|
@@ -271,8 +271,8 @@ files:
|
|
|
271
271
|
- docs/ExtractionInfo.md
|
|
272
272
|
- docs/FacturXInvoice.md
|
|
273
273
|
- docs/FacturXPDFInfo.md
|
|
274
|
+
- docs/FactureElectroniqueModelsInvoiceTypeCode.md
|
|
274
275
|
- docs/FactureElectroniqueRestApiSchemasCdarValidationErrorResponse.md
|
|
275
|
-
- docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md
|
|
276
276
|
- docs/FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md
|
|
277
277
|
- docs/FieldStatus.md
|
|
278
278
|
- docs/FileInfo.md
|
|
@@ -590,8 +590,8 @@ files:
|
|
|
590
590
|
- lib/factpulse/models/extraction_info.rb
|
|
591
591
|
- lib/factpulse/models/factur_x_invoice.rb
|
|
592
592
|
- lib/factpulse/models/factur_xpdf_info.rb
|
|
593
|
+
- lib/factpulse/models/facture_electronique_models_invoice_type_code.rb
|
|
593
594
|
- lib/factpulse/models/facture_electronique_rest_api_schemas_cdar_validation_error_response.rb
|
|
594
|
-
- lib/factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code.rb
|
|
595
595
|
- lib/factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb
|
|
596
596
|
- lib/factpulse/models/field_status.rb
|
|
597
597
|
- lib/factpulse/models/file_info.rb
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# FactPulse::FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode
|
|
2
|
-
|
|
3
|
-
## Properties
|
|
4
|
-
|
|
5
|
-
| Name | Type | Description | Notes |
|
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
|
|
8
|
-
## Example
|
|
9
|
-
|
|
10
|
-
```ruby
|
|
11
|
-
require 'factpulse'
|
|
12
|
-
|
|
13
|
-
instance = FactPulse::FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.new()
|
|
14
|
-
```
|
|
15
|
-
|