factpulse 3.0.19 → 3.0.24
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 +3 -3
- data/Gemfile.lock +1 -1
- data/docs/{FactureElectroniqueRestApiSchemasEreportingValidationError.md → EReportingValidationError.md} +2 -2
- data/docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md +15 -0
- data/docs/InvoiceInput.md +1 -1
- data/docs/SchematronValidationError.md +32 -0
- data/docs/SimplifiedInvoiceData.md +1 -1
- data/docs/ValidateEReportingResponse.md +2 -2
- data/docs/ValidationInfo.md +1 -1
- data/lib/factpulse/helpers/client.rb +38 -9
- data/lib/factpulse/models/{facture_electronique_rest_api_schemas_ereporting_validation_error.rb → e_reporting_validation_error.rb} +4 -4
- data/lib/factpulse/models/{facture_electronique_models_invoice_type_code.rb → facture_electronique_rest_api_schemas_ereporting_invoice_type_code.rb} +9 -20
- data/lib/factpulse/models/invoice_input.rb +1 -1
- data/lib/factpulse/models/invoice_type_code.rb +17 -6
- data/lib/factpulse/models/schematron_validation_error.rb +294 -0
- data/lib/factpulse/models/simplified_invoice_data.rb +1 -1
- data/lib/factpulse/models/validate_e_reporting_response.rb +2 -2
- data/lib/factpulse/models/validation_info.rb +1 -1
- data/lib/factpulse/version.rb +1 -1
- data/lib/factpulse.rb +3 -2
- metadata +8 -6
- data/docs/FactureElectroniqueModelsInvoiceTypeCode.md +0 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aec6c8e7039f5afbc6471af5f58687a89598fe01365340776250175d2414c1de
|
|
4
|
+
data.tar.gz: ac8d56ca45264368bd14a8129cb74ee0014531cfd64e31e935ae6061d6465a25
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c73a56a1e16899b261016363b23faaccac4f2bbbcadf985777bd81c632142f6611f38eede8f191f7f25631466ed03d722112e175471e238c864536d796e70904
|
|
7
|
+
data.tar.gz: b7e23db9ac18e69945ece83abbc4a6cbb14b0e87c9c54cba6386c93e9a23dbca7287e7441876cbc0c37defb99c4d63b75047f3e6d03340396a2d661494eacb18
|
data/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,7 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
## [3.0.
|
|
10
|
+
## [3.0.24] - 2026-01-15
|
|
11
11
|
|
|
12
12
|
### Added
|
|
13
13
|
- Version initiale du SDK ruby
|
|
@@ -24,5 +24,5 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
24
24
|
- Guide d'authentification JWT
|
|
25
25
|
- Configuration avancée (timeout, proxy, debug)
|
|
26
26
|
|
|
27
|
-
[Unreleased]: https://github.com/factpulse/sdk-ruby/compare/v3.0.
|
|
28
|
-
[3.0.
|
|
27
|
+
[Unreleased]: https://github.com/factpulse/sdk-ruby/compare/v3.0.24...HEAD
|
|
28
|
+
[3.0.24]: https://github.com/factpulse/sdk-ruby/releases/tag/v3.0.24
|
data/Gemfile.lock
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# FactPulse::
|
|
1
|
+
# FactPulse::EReportingValidationError
|
|
2
2
|
|
|
3
3
|
## Properties
|
|
4
4
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
```ruby
|
|
14
14
|
require 'factpulse'
|
|
15
15
|
|
|
16
|
-
instance = FactPulse::
|
|
16
|
+
instance = FactPulse::EReportingValidationError.new(
|
|
17
17
|
field: null,
|
|
18
18
|
message: null,
|
|
19
19
|
code: null
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
|
data/docs/InvoiceInput.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **invoice_id** | **String** | Invoice identifier | |
|
|
8
8
|
| **issue_date** | **Date** | Invoice issue date | |
|
|
9
|
-
| **type_code** | [**
|
|
9
|
+
| **type_code** | [**FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode**](FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md) | Invoice type code | [optional] |
|
|
10
10
|
| **currency** | [**Currency**](Currency.md) | | [optional] |
|
|
11
11
|
| **due_date** | **Date** | | [optional] |
|
|
12
12
|
| **seller_siren** | **String** | Seller SIREN/SIRET | |
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# FactPulse::SchematronValidationError
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **rule** | **String** | Code de la regle (BR-XX, BR-FR-XX) | |
|
|
8
|
+
| **bt_code** | **String** | | [optional] |
|
|
9
|
+
| **severity** | **String** | Gravite: error, warning | |
|
|
10
|
+
| **message** | **String** | Message d'erreur | |
|
|
11
|
+
| **suggested_value** | **String** | | [optional] |
|
|
12
|
+
| **suggested_field** | **String** | | [optional] |
|
|
13
|
+
| **explanation** | **String** | | [optional] |
|
|
14
|
+
| **confidence** | **Float** | | [optional] |
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
require 'factpulse'
|
|
20
|
+
|
|
21
|
+
instance = FactPulse::SchematronValidationError.new(
|
|
22
|
+
rule: null,
|
|
23
|
+
bt_code: null,
|
|
24
|
+
severity: null,
|
|
25
|
+
message: null,
|
|
26
|
+
suggested_value: null,
|
|
27
|
+
suggested_field: null,
|
|
28
|
+
explanation: null,
|
|
29
|
+
confidence: null
|
|
30
|
+
)
|
|
31
|
+
```
|
|
32
|
+
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
| **comment** | **String** | | [optional] |
|
|
14
14
|
| **purchase_order_reference** | **String** | | [optional] |
|
|
15
15
|
| **contract_reference** | **String** | | [optional] |
|
|
16
|
-
| **invoice_type** | [**
|
|
16
|
+
| **invoice_type** | [**InvoiceTypeCode**](InvoiceTypeCode.md) | Document type (UNTDID 1001). Default: 380 (Invoice). | [optional] |
|
|
17
17
|
| **preceding_invoice_reference** | **String** | | [optional] |
|
|
18
18
|
| **operation_nature** | [**OperationNature**](OperationNature.md) | | [optional] |
|
|
19
19
|
| **invoicing_framework** | [**InvoicingFrameworkCode**](InvoicingFrameworkCode.md) | | [optional] |
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
| **valid** | **Boolean** | Whether the data is valid | |
|
|
8
8
|
| **report_id** | **String** | Report identifier | |
|
|
9
9
|
| **flow_type** | **String** | Flux type | |
|
|
10
|
-
| **errors** | [**Array<
|
|
11
|
-
| **warnings** | [**Array<
|
|
10
|
+
| **errors** | [**Array<EReportingValidationError>**](EReportingValidationError.md) | List of validation errors (if any) | [optional] |
|
|
11
|
+
| **warnings** | [**Array<EReportingValidationError>**](EReportingValidationError.md) | List of validation warnings (if any) | [optional] |
|
|
12
12
|
| **message** | **String** | Status message | |
|
|
13
13
|
|
|
14
14
|
## Example
|
data/docs/ValidationInfo.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
| **schematron_rules_total** | **Integer** | Total regles | |
|
|
10
10
|
| **pdfa_compliant** | **Boolean** | PDF/A-3 conforme | [optional][default to true] |
|
|
11
11
|
| **xml_embedded** | **Boolean** | XML embarque dans PDF | [optional][default to true] |
|
|
12
|
-
| **errors** | [**Array<
|
|
12
|
+
| **errors** | [**Array<SchematronValidationError>**](SchematronValidationError.md) | | [optional] |
|
|
13
13
|
|
|
14
14
|
## Example
|
|
15
15
|
|
|
@@ -462,19 +462,48 @@ module FactPulse
|
|
|
462
462
|
|
|
463
463
|
# ==================== AFNOR Directory ====================
|
|
464
464
|
|
|
465
|
-
#
|
|
466
|
-
|
|
467
|
-
|
|
465
|
+
# Gets a company (legal unit) by SIRET in the AFNOR directory.
|
|
466
|
+
# @param siret [String] 14-digit SIRET number
|
|
467
|
+
# @return [Hash] Company information
|
|
468
|
+
def get_siret_afnor(siret)
|
|
469
|
+
make_afnor_request('GET', "/directory/v1/siret/code-insee:#{siret}")
|
|
468
470
|
end
|
|
469
471
|
|
|
470
|
-
#
|
|
471
|
-
|
|
472
|
-
|
|
472
|
+
# Gets a company (legal unit) by SIREN in the AFNOR directory.
|
|
473
|
+
# @param siren [String] 9-digit SIREN number
|
|
474
|
+
# @return [Hash] Company information
|
|
475
|
+
def get_siren_afnor(siren)
|
|
476
|
+
make_afnor_request('GET', "/directory/v1/siren/code-insee:#{siren}")
|
|
473
477
|
end
|
|
474
478
|
|
|
475
|
-
#
|
|
476
|
-
|
|
477
|
-
|
|
479
|
+
# Searches for SIRENs (legal units) in the AFNOR directory.
|
|
480
|
+
# @param criteria [Hash] Search criteria (filters, sorting, fields, limit)
|
|
481
|
+
# @return [Hash] Search results
|
|
482
|
+
def search_siren_afnor(**criteria)
|
|
483
|
+
search_body = {
|
|
484
|
+
'limit' => criteria[:limit] || 25,
|
|
485
|
+
'filters' => criteria[:filters] || {}
|
|
486
|
+
}
|
|
487
|
+
make_afnor_request('POST', '/directory/v1/siren/search', json_data: search_body)
|
|
488
|
+
end
|
|
489
|
+
|
|
490
|
+
# Searches for routing codes in the AFNOR directory.
|
|
491
|
+
# @param criteria [Hash] Search criteria (filters, sorting, fields, limit)
|
|
492
|
+
# @return [Hash] Search results with routing codes
|
|
493
|
+
def search_routing_codes_afnor(**criteria)
|
|
494
|
+
search_body = {
|
|
495
|
+
'limit' => criteria[:limit] || 25,
|
|
496
|
+
'filters' => criteria[:filters] || {}
|
|
497
|
+
}
|
|
498
|
+
make_afnor_request('POST', '/directory/v1/routing-code/search', json_data: search_body)
|
|
499
|
+
end
|
|
500
|
+
|
|
501
|
+
# Gets a routing code by SIRET and routing identifier.
|
|
502
|
+
# @param siret [String] 14-digit SIRET number
|
|
503
|
+
# @param routing_identifier [String] Routing code identifier
|
|
504
|
+
# @return [Hash] Routing code information
|
|
505
|
+
def get_routing_code_afnor(siret, routing_identifier)
|
|
506
|
+
make_afnor_request('GET', "/directory/v1/routing-code/siret:#{siret}/code:#{routing_identifier}")
|
|
478
507
|
end
|
|
479
508
|
|
|
480
509
|
# =========================================================================
|
|
@@ -14,8 +14,8 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
|
-
# Validation error detail.
|
|
18
|
-
class
|
|
17
|
+
# Validation error detail for E-Reporting.
|
|
18
|
+
class EReportingValidationError < ApiModelBase
|
|
19
19
|
# Field path with error
|
|
20
20
|
attr_accessor :field
|
|
21
21
|
|
|
@@ -63,14 +63,14 @@ module FactPulse
|
|
|
63
63
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
64
|
def initialize(attributes = {})
|
|
65
65
|
if (!attributes.is_a?(Hash))
|
|
66
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::EReportingValidationError` initialize method"
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
70
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
71
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
72
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::EReportingValidationError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
74
|
end
|
|
75
75
|
h[k.to_sym] = v
|
|
76
76
|
}
|
|
@@ -14,26 +14,15 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
|
-
class
|
|
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
|
|
17
|
+
class FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode
|
|
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
|
|
@@ -47,8 +36,8 @@ module FactPulse
|
|
|
47
36
|
# @param [String] The enum value in the form of the string
|
|
48
37
|
# @return [String] The enum value
|
|
49
38
|
def build_from_hash(value)
|
|
50
|
-
return value if
|
|
51
|
-
raise "Invalid ENUM value #{value} for class #
|
|
39
|
+
return value if FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.all_vars.include?(value)
|
|
40
|
+
raise "Invalid ENUM value #{value} for class #FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode"
|
|
52
41
|
end
|
|
53
42
|
end
|
|
54
43
|
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' => :'FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode',
|
|
116
116
|
:'currency' => :'Currency',
|
|
117
117
|
:'due_date' => :'Date',
|
|
118
118
|
:'seller_siren' => :'String',
|
|
@@ -15,14 +15,25 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
17
|
class InvoiceTypeCode
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#FactPulse REST API
|
|
3
|
+
|
|
4
|
+
# REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: contact@factpulse.fr
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module FactPulse
|
|
17
|
+
# Erreur de validation Schematron avec suggestion de correction.
|
|
18
|
+
class SchematronValidationError < ApiModelBase
|
|
19
|
+
# Code de la regle (BR-XX, BR-FR-XX)
|
|
20
|
+
attr_accessor :rule
|
|
21
|
+
|
|
22
|
+
attr_accessor :bt_code
|
|
23
|
+
|
|
24
|
+
# Gravite: error, warning
|
|
25
|
+
attr_accessor :severity
|
|
26
|
+
|
|
27
|
+
# Message d'erreur
|
|
28
|
+
attr_accessor :message
|
|
29
|
+
|
|
30
|
+
attr_accessor :suggested_value
|
|
31
|
+
|
|
32
|
+
attr_accessor :suggested_field
|
|
33
|
+
|
|
34
|
+
attr_accessor :explanation
|
|
35
|
+
|
|
36
|
+
attr_accessor :confidence
|
|
37
|
+
|
|
38
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
39
|
+
def self.attribute_map
|
|
40
|
+
{
|
|
41
|
+
:'rule' => :'rule',
|
|
42
|
+
:'bt_code' => :'bt_code',
|
|
43
|
+
:'severity' => :'severity',
|
|
44
|
+
:'message' => :'message',
|
|
45
|
+
:'suggested_value' => :'suggested_value',
|
|
46
|
+
:'suggested_field' => :'suggested_field',
|
|
47
|
+
:'explanation' => :'explanation',
|
|
48
|
+
:'confidence' => :'confidence'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns attribute mapping this model knows about
|
|
53
|
+
def self.acceptable_attribute_map
|
|
54
|
+
attribute_map
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns all the JSON keys this model knows about
|
|
58
|
+
def self.acceptable_attributes
|
|
59
|
+
acceptable_attribute_map.values
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Attribute type mapping.
|
|
63
|
+
def self.openapi_types
|
|
64
|
+
{
|
|
65
|
+
:'rule' => :'String',
|
|
66
|
+
:'bt_code' => :'String',
|
|
67
|
+
:'severity' => :'String',
|
|
68
|
+
:'message' => :'String',
|
|
69
|
+
:'suggested_value' => :'String',
|
|
70
|
+
:'suggested_field' => :'String',
|
|
71
|
+
:'explanation' => :'String',
|
|
72
|
+
:'confidence' => :'Float'
|
|
73
|
+
}
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# List of attributes with nullable: true
|
|
77
|
+
def self.openapi_nullable
|
|
78
|
+
Set.new([
|
|
79
|
+
:'bt_code',
|
|
80
|
+
:'suggested_value',
|
|
81
|
+
:'suggested_field',
|
|
82
|
+
:'explanation',
|
|
83
|
+
:'confidence'
|
|
84
|
+
])
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Initializes the object
|
|
88
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
89
|
+
def initialize(attributes = {})
|
|
90
|
+
if (!attributes.is_a?(Hash))
|
|
91
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::SchematronValidationError` initialize method"
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
95
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
96
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
97
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
98
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::SchematronValidationError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
99
|
+
end
|
|
100
|
+
h[k.to_sym] = v
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'rule')
|
|
104
|
+
self.rule = attributes[:'rule']
|
|
105
|
+
else
|
|
106
|
+
self.rule = nil
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'bt_code')
|
|
110
|
+
self.bt_code = attributes[:'bt_code']
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'severity')
|
|
114
|
+
self.severity = attributes[:'severity']
|
|
115
|
+
else
|
|
116
|
+
self.severity = nil
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'message')
|
|
120
|
+
self.message = attributes[:'message']
|
|
121
|
+
else
|
|
122
|
+
self.message = nil
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if attributes.key?(:'suggested_value')
|
|
126
|
+
self.suggested_value = attributes[:'suggested_value']
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if attributes.key?(:'suggested_field')
|
|
130
|
+
self.suggested_field = attributes[:'suggested_field']
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if attributes.key?(:'explanation')
|
|
134
|
+
self.explanation = attributes[:'explanation']
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if attributes.key?(:'confidence')
|
|
138
|
+
self.confidence = attributes[:'confidence']
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
143
|
+
# @return Array for valid properties with the reasons
|
|
144
|
+
def list_invalid_properties
|
|
145
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
146
|
+
invalid_properties = Array.new
|
|
147
|
+
if @rule.nil?
|
|
148
|
+
invalid_properties.push('invalid value for "rule", rule cannot be nil.')
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if @severity.nil?
|
|
152
|
+
invalid_properties.push('invalid value for "severity", severity cannot be nil.')
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if @message.nil?
|
|
156
|
+
invalid_properties.push('invalid value for "message", message cannot be nil.')
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if !@confidence.nil? && @confidence > 1.0
|
|
160
|
+
invalid_properties.push('invalid value for "confidence", must be smaller than or equal to 1.0.')
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
if !@confidence.nil? && @confidence < 0.0
|
|
164
|
+
invalid_properties.push('invalid value for "confidence", must be greater than or equal to 0.0.')
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
invalid_properties
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Check to see if the all the properties in the model are valid
|
|
171
|
+
# @return true if the model is valid
|
|
172
|
+
def valid?
|
|
173
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
174
|
+
return false if @rule.nil?
|
|
175
|
+
return false if @severity.nil?
|
|
176
|
+
return false if @message.nil?
|
|
177
|
+
return false if !@confidence.nil? && @confidence > 1.0
|
|
178
|
+
return false if !@confidence.nil? && @confidence < 0.0
|
|
179
|
+
true
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Custom attribute writer method with validation
|
|
183
|
+
# @param [Object] rule Value to be assigned
|
|
184
|
+
def rule=(rule)
|
|
185
|
+
if rule.nil?
|
|
186
|
+
fail ArgumentError, 'rule cannot be nil'
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
@rule = rule
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Custom attribute writer method with validation
|
|
193
|
+
# @param [Object] severity Value to be assigned
|
|
194
|
+
def severity=(severity)
|
|
195
|
+
if severity.nil?
|
|
196
|
+
fail ArgumentError, 'severity cannot be nil'
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
@severity = severity
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Custom attribute writer method with validation
|
|
203
|
+
# @param [Object] message Value to be assigned
|
|
204
|
+
def message=(message)
|
|
205
|
+
if message.nil?
|
|
206
|
+
fail ArgumentError, 'message cannot be nil'
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
@message = message
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Custom attribute writer method with validation
|
|
213
|
+
# @param [Object] confidence Value to be assigned
|
|
214
|
+
def confidence=(confidence)
|
|
215
|
+
if !confidence.nil? && confidence > 1.0
|
|
216
|
+
fail ArgumentError, 'invalid value for "confidence", must be smaller than or equal to 1.0.'
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
if !confidence.nil? && confidence < 0.0
|
|
220
|
+
fail ArgumentError, 'invalid value for "confidence", must be greater than or equal to 0.0.'
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
@confidence = confidence
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Checks equality by comparing each attribute.
|
|
227
|
+
# @param [Object] Object to be compared
|
|
228
|
+
def ==(o)
|
|
229
|
+
return true if self.equal?(o)
|
|
230
|
+
self.class == o.class &&
|
|
231
|
+
rule == o.rule &&
|
|
232
|
+
bt_code == o.bt_code &&
|
|
233
|
+
severity == o.severity &&
|
|
234
|
+
message == o.message &&
|
|
235
|
+
suggested_value == o.suggested_value &&
|
|
236
|
+
suggested_field == o.suggested_field &&
|
|
237
|
+
explanation == o.explanation &&
|
|
238
|
+
confidence == o.confidence
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# @see the `==` method
|
|
242
|
+
# @param [Object] Object to be compared
|
|
243
|
+
def eql?(o)
|
|
244
|
+
self == o
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# Calculates hash code according to all attributes.
|
|
248
|
+
# @return [Integer] Hash code
|
|
249
|
+
def hash
|
|
250
|
+
[rule, bt_code, severity, message, suggested_value, suggested_field, explanation, confidence].hash
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
# Builds the object from hash
|
|
254
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
255
|
+
# @return [Object] Returns the model itself
|
|
256
|
+
def self.build_from_hash(attributes)
|
|
257
|
+
return nil unless attributes.is_a?(Hash)
|
|
258
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
259
|
+
transformed_hash = {}
|
|
260
|
+
openapi_types.each_pair do |key, type|
|
|
261
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
262
|
+
transformed_hash["#{key}"] = nil
|
|
263
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
264
|
+
# check to ensure the input is an array given that the attribute
|
|
265
|
+
# is documented as an array but the input is not
|
|
266
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
267
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
268
|
+
end
|
|
269
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
270
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
new(transformed_hash)
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
# Returns the object in the form of hash
|
|
277
|
+
# @return [Hash] Returns the object in the form of hash
|
|
278
|
+
def to_hash
|
|
279
|
+
hash = {}
|
|
280
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
281
|
+
value = self.send(attr)
|
|
282
|
+
if value.nil?
|
|
283
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
284
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
hash[param] = _to_hash(value)
|
|
288
|
+
end
|
|
289
|
+
hash
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
end
|
|
@@ -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' => :'InvoiceTypeCode',
|
|
115
115
|
:'preceding_invoice_reference' => :'String',
|
|
116
116
|
:'operation_nature' => :'OperationNature',
|
|
117
117
|
:'invoicing_framework' => :'InvoicingFrameworkCode'
|
|
@@ -62,8 +62,8 @@ module FactPulse
|
|
|
62
62
|
:'valid' => :'Boolean',
|
|
63
63
|
:'report_id' => :'String',
|
|
64
64
|
:'flow_type' => :'String',
|
|
65
|
-
:'errors' => :'Array<
|
|
66
|
-
:'warnings' => :'Array<
|
|
65
|
+
:'errors' => :'Array<EReportingValidationError>',
|
|
66
|
+
:'warnings' => :'Array<EReportingValidationError>',
|
|
67
67
|
:'message' => :'String'
|
|
68
68
|
}
|
|
69
69
|
end
|
data/lib/factpulse/version.rb
CHANGED
data/lib/factpulse.rb
CHANGED
|
@@ -152,6 +152,7 @@ require 'factpulse/models/directory_line_include'
|
|
|
152
152
|
require 'factpulse/models/doc_type'
|
|
153
153
|
require 'factpulse/models/document_type_info'
|
|
154
154
|
require 'factpulse/models/e_reporting_flow_type'
|
|
155
|
+
require 'factpulse/models/e_reporting_validation_error'
|
|
155
156
|
require 'factpulse/models/electronic_address'
|
|
156
157
|
require 'factpulse/models/enriched_invoice_info'
|
|
157
158
|
require 'factpulse/models/error_level'
|
|
@@ -159,8 +160,7 @@ require 'factpulse/models/error_source'
|
|
|
159
160
|
require 'factpulse/models/extraction_info'
|
|
160
161
|
require 'factpulse/models/factur_x_invoice'
|
|
161
162
|
require 'factpulse/models/factur_xpdf_info'
|
|
162
|
-
require 'factpulse/models/
|
|
163
|
-
require 'factpulse/models/facture_electronique_rest_api_schemas_ereporting_validation_error'
|
|
163
|
+
require 'factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code'
|
|
164
164
|
require 'factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials'
|
|
165
165
|
require 'factpulse/models/field_status'
|
|
166
166
|
require 'factpulse/models/file_info'
|
|
@@ -232,6 +232,7 @@ require 'factpulse/models/report_period'
|
|
|
232
232
|
require 'factpulse/models/report_sender'
|
|
233
233
|
require 'factpulse/models/rounding_amount'
|
|
234
234
|
require 'factpulse/models/routing_code_include'
|
|
235
|
+
require 'factpulse/models/schematron_validation_error'
|
|
235
236
|
require 'factpulse/models/scheme_id'
|
|
236
237
|
require 'factpulse/models/search_flow_request'
|
|
237
238
|
require 'factpulse/models/search_flow_response'
|
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: 3.0.
|
|
4
|
+
version: 3.0.24
|
|
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-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: typhoeus
|
|
@@ -257,6 +257,7 @@ files:
|
|
|
257
257
|
- docs/DownloadsApi.md
|
|
258
258
|
- docs/EReportingApi.md
|
|
259
259
|
- docs/EReportingFlowType.md
|
|
260
|
+
- docs/EReportingValidationError.md
|
|
260
261
|
- docs/ElectronicAddress.md
|
|
261
262
|
- docs/EnrichedInvoiceInfo.md
|
|
262
263
|
- docs/ErrorLevel.md
|
|
@@ -264,8 +265,7 @@ files:
|
|
|
264
265
|
- docs/ExtractionInfo.md
|
|
265
266
|
- docs/FacturXInvoice.md
|
|
266
267
|
- docs/FacturXPDFInfo.md
|
|
267
|
-
- docs/
|
|
268
|
-
- docs/FactureElectroniqueRestApiSchemasEreportingValidationError.md
|
|
268
|
+
- docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md
|
|
269
269
|
- docs/FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md
|
|
270
270
|
- docs/FieldStatus.md
|
|
271
271
|
- docs/FileInfo.md
|
|
@@ -340,6 +340,7 @@ files:
|
|
|
340
340
|
- docs/ReportSender.md
|
|
341
341
|
- docs/RoundingAmount.md
|
|
342
342
|
- docs/RoutingCodeInclude.md
|
|
343
|
+
- docs/SchematronValidationError.md
|
|
343
344
|
- docs/SchemeID.md
|
|
344
345
|
- docs/SearchFlowRequest.md
|
|
345
346
|
- docs/SearchFlowResponse.md
|
|
@@ -559,6 +560,7 @@ files:
|
|
|
559
560
|
- lib/factpulse/models/doc_type.rb
|
|
560
561
|
- lib/factpulse/models/document_type_info.rb
|
|
561
562
|
- lib/factpulse/models/e_reporting_flow_type.rb
|
|
563
|
+
- lib/factpulse/models/e_reporting_validation_error.rb
|
|
562
564
|
- lib/factpulse/models/electronic_address.rb
|
|
563
565
|
- lib/factpulse/models/enriched_invoice_info.rb
|
|
564
566
|
- lib/factpulse/models/error_level.rb
|
|
@@ -566,8 +568,7 @@ files:
|
|
|
566
568
|
- lib/factpulse/models/extraction_info.rb
|
|
567
569
|
- lib/factpulse/models/factur_x_invoice.rb
|
|
568
570
|
- lib/factpulse/models/factur_xpdf_info.rb
|
|
569
|
-
- lib/factpulse/models/
|
|
570
|
-
- lib/factpulse/models/facture_electronique_rest_api_schemas_ereporting_validation_error.rb
|
|
571
|
+
- lib/factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code.rb
|
|
571
572
|
- lib/factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb
|
|
572
573
|
- lib/factpulse/models/field_status.rb
|
|
573
574
|
- lib/factpulse/models/file_info.rb
|
|
@@ -639,6 +640,7 @@ files:
|
|
|
639
640
|
- lib/factpulse/models/report_sender.rb
|
|
640
641
|
- lib/factpulse/models/rounding_amount.rb
|
|
641
642
|
- lib/factpulse/models/routing_code_include.rb
|
|
643
|
+
- lib/factpulse/models/schematron_validation_error.rb
|
|
642
644
|
- lib/factpulse/models/scheme_id.rb
|
|
643
645
|
- lib/factpulse/models/search_flow_request.rb
|
|
644
646
|
- lib/factpulse/models/search_flow_response.rb
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# FactPulse::FactureElectroniqueModelsInvoiceTypeCode
|
|
2
|
-
|
|
3
|
-
## Properties
|
|
4
|
-
|
|
5
|
-
| Name | Type | Description | Notes |
|
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
|
|
8
|
-
## Example
|
|
9
|
-
|
|
10
|
-
```ruby
|
|
11
|
-
require 'factpulse'
|
|
12
|
-
|
|
13
|
-
instance = FactPulse::FactureElectroniqueModelsInvoiceTypeCode.new()
|
|
14
|
-
```
|
|
15
|
-
|