factpulse 3.0.4 → 3.0.6
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/AdditionalDocument.md +26 -0
- data/docs/AllowanceCharge.md +32 -0
- data/docs/AllowanceTotalAmount.md +15 -0
- data/docs/{APIProfile.md → Amount.md} +2 -2
- data/docs/{DocumentType.md → BaseAmount.md} +2 -2
- data/docs/ChargeTotalAmount.md +15 -0
- data/docs/Contact.md +24 -0
- data/docs/ConvertErrorResponse.md +26 -0
- data/docs/ConvertPendingInputResponse.md +32 -0
- data/docs/ConvertResumeRequest.md +18 -0
- data/docs/ConvertSuccessResponse.md +36 -0
- data/docs/ConvertValidationFailedResponse.md +34 -0
- data/docs/DeliveryParty.md +24 -0
- data/docs/DocumentConversionApi.md +373 -0
- data/docs/DocumentTypeInfo.md +22 -0
- data/docs/ExtractionInfo.md +24 -0
- data/docs/FacturXInvoice.md +29 -1
- data/docs/FacturXProfile.md +15 -0
- data/docs/FileInfo.md +20 -0
- data/docs/FilesInfo.md +20 -0
- data/docs/GrossUnitPrice.md +15 -0
- data/docs/IncomingInvoice.md +1 -1
- data/docs/InvoiceLine.md +43 -9
- data/docs/InvoiceProcessingApi.md +8 -8
- data/docs/InvoiceReferences.md +26 -6
- data/docs/InvoiceTotals.md +10 -2
- data/docs/LineTotalAmount.md +15 -0
- data/docs/MissingField.md +28 -0
- data/docs/Payee.md +5 -1
- data/docs/PaymentCard.md +20 -0
- data/docs/Percentage.md +15 -0
- data/docs/PostalAddress.md +5 -1
- data/docs/PriceAllowanceAmount.md +15 -0
- data/docs/PriceBasisQuantity.md +15 -0
- data/docs/ProcessingOptions.md +3 -3
- data/docs/ProductCharacteristic.md +20 -0
- data/docs/ProductClassification.md +22 -0
- data/docs/Recipient.md +7 -1
- data/docs/RoundingAmount.md +15 -0
- data/docs/Supplier.md +17 -1
- data/docs/TaxRepresentative.md +22 -0
- data/docs/VATLine.md +2 -0
- data/docs/VATPointDateCode.md +15 -0
- data/docs/ValidationInfo.md +28 -0
- data/docs/VatRate.md +15 -0
- data/factpulse.gemspec +1 -1
- data/lib/factpulse/api/afnorpdppa_api.rb +1 -1
- data/lib/factpulse/api/afnorpdppa_directory_service_api.rb +1 -1
- data/lib/factpulse/api/afnorpdppa_flow_service_api.rb +1 -1
- data/lib/factpulse/api/chorus_pro_api.rb +1 -1
- data/lib/factpulse/api/document_conversion_api.rb +378 -0
- data/lib/factpulse/api/health_api.rb +1 -1
- data/lib/factpulse/api/invoice_processing_api.rb +9 -9
- data/lib/factpulse/api/pdfxml_verification_api.rb +1 -1
- data/lib/factpulse/api/user_api.rb +1 -1
- data/lib/factpulse/api_client.rb +1 -1
- data/lib/factpulse/api_error.rb +1 -1
- data/lib/factpulse/api_model_base.rb +1 -1
- data/lib/factpulse/configuration.rb +1 -1
- data/lib/factpulse/models/acknowledgment_status.rb +1 -1
- data/lib/factpulse/models/additional_document.rb +206 -0
- data/lib/factpulse/models/afnor_credentials.rb +1 -1
- data/lib/factpulse/models/afnor_destination.rb +1 -1
- data/lib/factpulse/models/afnor_health_check_response.rb +1 -1
- data/lib/factpulse/models/afnor_result.rb +1 -1
- data/lib/factpulse/models/allowance_charge.rb +252 -0
- data/lib/factpulse/models/allowance_reason_code.rb +1 -1
- data/lib/factpulse/models/allowance_total_amount.rb +104 -0
- data/lib/factpulse/models/amount.rb +104 -0
- data/lib/factpulse/models/amount_due.rb +2 -2
- data/lib/factpulse/models/api_error.rb +1 -1
- data/lib/factpulse/models/async_task_status.rb +1 -1
- data/lib/factpulse/models/base_amount.rb +104 -0
- data/lib/factpulse/models/bounding_box_schema.rb +1 -1
- data/lib/factpulse/models/celery_status.rb +1 -1
- data/lib/factpulse/models/certificate_info_response.rb +1 -1
- data/lib/factpulse/models/charge_total_amount.rb +104 -0
- data/lib/factpulse/models/chorus_pro_destination.rb +1 -1
- data/lib/factpulse/models/chorus_pro_result.rb +1 -1
- data/lib/factpulse/models/contact.rb +179 -0
- data/lib/factpulse/models/convert_error_response.rb +224 -0
- data/lib/factpulse/models/convert_pending_input_response.rb +322 -0
- data/lib/factpulse/models/convert_resume_request.rb +151 -0
- data/lib/factpulse/models/convert_success_response.rb +360 -0
- data/lib/factpulse/models/convert_validation_failed_response.rb +334 -0
- data/lib/factpulse/models/delivery_party.rb +179 -0
- data/lib/factpulse/models/destination.rb +1 -1
- data/lib/factpulse/models/document_type_info.rb +220 -0
- data/lib/factpulse/models/electronic_address.rb +1 -1
- data/lib/factpulse/models/enriched_invoice_info.rb +1 -1
- data/lib/factpulse/models/error_level.rb +1 -1
- data/lib/factpulse/models/error_source.rb +1 -1
- data/lib/factpulse/models/extraction_info.rb +217 -0
- data/lib/factpulse/models/factur_x_invoice.rb +150 -6
- data/lib/factpulse/models/{api_profile.rb → factur_x_profile.rb} +4 -4
- data/lib/factpulse/models/factur_xpdf_info.rb +1 -1
- data/lib/factpulse/models/facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.rb +5 -5
- data/lib/factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb +1 -1
- data/lib/factpulse/models/field_status.rb +1 -1
- data/lib/factpulse/models/file_info.rb +161 -0
- data/lib/factpulse/models/files_info.rb +159 -0
- data/lib/factpulse/models/flow_direction.rb +1 -1
- data/lib/factpulse/models/flow_profile.rb +1 -1
- data/lib/factpulse/models/flow_summary.rb +1 -1
- data/lib/factpulse/models/flow_syntax.rb +1 -1
- data/lib/factpulse/models/flow_type.rb +1 -1
- data/lib/factpulse/models/generate_certificate_request.rb +6 -6
- data/lib/factpulse/models/generate_certificate_response.rb +1 -1
- data/lib/factpulse/models/get_chorus_pro_id_request.rb +2 -2
- data/lib/factpulse/models/get_chorus_pro_id_response.rb +1 -1
- data/lib/factpulse/models/get_invoice_request.rb +2 -2
- data/lib/factpulse/models/get_invoice_response.rb +1 -1
- data/lib/factpulse/models/get_structure_request.rb +3 -3
- data/lib/factpulse/models/get_structure_response.rb +1 -1
- data/lib/factpulse/models/global_allowance_amount.rb +2 -2
- data/lib/factpulse/models/gross_unit_price.rb +104 -0
- data/lib/factpulse/models/http_validation_error.rb +1 -1
- data/lib/factpulse/models/incoming_invoice.rb +2 -2
- data/lib/factpulse/models/incoming_supplier.rb +1 -1
- data/lib/factpulse/models/invoice_format.rb +1 -1
- data/lib/factpulse/models/invoice_line.rb +209 -25
- data/lib/factpulse/models/invoice_line_allowance_amount.rb +2 -2
- data/lib/factpulse/models/invoice_note.rb +1 -1
- data/lib/factpulse/models/invoice_references.rb +119 -16
- data/lib/factpulse/models/invoice_status.rb +1 -1
- data/lib/factpulse/models/invoice_totals.rb +52 -12
- data/lib/factpulse/models/invoice_totals_prepayment.rb +2 -2
- data/lib/factpulse/models/invoice_type_code.rb +1 -1
- data/lib/factpulse/models/invoicing_framework.rb +1 -1
- data/lib/factpulse/models/invoicing_framework_code.rb +1 -1
- data/lib/factpulse/models/line_net_amount.rb +2 -2
- data/lib/factpulse/models/line_total_amount.rb +104 -0
- data/lib/factpulse/models/mandatory_note_schema.rb +1 -1
- data/lib/factpulse/models/manual_rate.rb +2 -2
- data/lib/factpulse/models/manual_vat_rate.rb +2 -2
- data/lib/factpulse/models/missing_field.rb +269 -0
- data/lib/factpulse/models/operation_nature.rb +1 -1
- data/lib/factpulse/models/output_format.rb +1 -1
- data/lib/factpulse/models/page_dimensions_schema.rb +1 -1
- data/lib/factpulse/models/payee.rb +28 -6
- data/lib/factpulse/models/payment_card.rb +159 -0
- data/lib/factpulse/models/payment_means.rb +1 -1
- data/lib/factpulse/models/pdf_validation_result_api.rb +1 -1
- data/lib/factpulse/models/pdp_credentials.rb +6 -6
- data/lib/factpulse/models/percentage.rb +104 -0
- data/lib/factpulse/models/postal_address.rb +27 -7
- data/lib/factpulse/models/price_allowance_amount.rb +104 -0
- data/lib/factpulse/models/price_basis_quantity.rb +104 -0
- data/lib/factpulse/models/processing_options.rb +10 -10
- data/lib/factpulse/models/product_characteristic.rb +193 -0
- data/lib/factpulse/models/product_classification.rb +186 -0
- data/lib/factpulse/models/quantity.rb +2 -2
- data/lib/factpulse/models/recipient.rb +39 -7
- data/lib/factpulse/models/rounding_amount.rb +104 -0
- data/lib/factpulse/models/scheme_id.rb +12 -6
- data/lib/factpulse/models/search_flow_request.rb +8 -8
- data/lib/factpulse/models/search_flow_response.rb +1 -1
- data/lib/factpulse/models/search_services_response.rb +1 -1
- data/lib/factpulse/models/search_structure_request.rb +5 -5
- data/lib/factpulse/models/search_structure_response.rb +1 -1
- data/lib/factpulse/models/signature_info.rb +1 -1
- data/lib/factpulse/models/signature_info_api.rb +1 -1
- data/lib/factpulse/models/signature_parameters.rb +1 -1
- data/lib/factpulse/models/simplified_invoice_data.rb +1 -1
- data/lib/factpulse/models/structure_info.rb +1 -1
- data/lib/factpulse/models/structure_parameters.rb +1 -1
- data/lib/factpulse/models/structure_service.rb +1 -1
- data/lib/factpulse/models/submission_mode.rb +1 -1
- data/lib/factpulse/models/submit_complete_invoice_request.rb +1 -1
- data/lib/factpulse/models/submit_complete_invoice_response.rb +1 -1
- data/lib/factpulse/models/submit_flow_request.rb +7 -7
- data/lib/factpulse/models/submit_flow_response.rb +1 -1
- data/lib/factpulse/models/submit_gross_amount.rb +1 -1
- data/lib/factpulse/models/submit_invoice_request.rb +14 -14
- data/lib/factpulse/models/submit_invoice_response.rb +1 -1
- data/lib/factpulse/models/submit_net_amount.rb +1 -1
- data/lib/factpulse/models/submit_vat_amount.rb +1 -1
- data/lib/factpulse/models/supplementary_attachment.rb +1 -1
- data/lib/factpulse/models/supplier.rb +89 -7
- data/lib/factpulse/models/task_response.rb +1 -1
- data/lib/factpulse/models/tax_representative.rb +220 -0
- data/lib/factpulse/models/taxable_amount.rb +2 -2
- data/lib/factpulse/models/total_gross_amount.rb +2 -2
- data/lib/factpulse/models/total_net_amount.rb +2 -2
- data/lib/factpulse/models/total_vat_amount.rb +2 -2
- data/lib/factpulse/models/unit_net_price.rb +2 -2
- data/lib/factpulse/models/unit_of_measure.rb +1 -1
- data/lib/factpulse/models/validation_error.rb +1 -1
- data/lib/factpulse/models/validation_error_detail.rb +1 -1
- data/lib/factpulse/models/validation_error_loc_inner.rb +1 -1
- data/lib/factpulse/models/validation_error_response.rb +1 -1
- data/lib/factpulse/models/validation_info.rb +255 -0
- data/lib/factpulse/models/validation_success_response.rb +1 -1
- data/lib/factpulse/models/vat_accounting_code.rb +1 -1
- data/lib/factpulse/models/vat_amount.rb +2 -2
- data/lib/factpulse/models/vat_category.rb +1 -1
- data/lib/factpulse/models/vat_line.rb +13 -3
- data/lib/factpulse/models/{document_type.rb → vat_point_date_code.rb} +8 -10
- data/lib/factpulse/models/vat_rate.rb +104 -0
- data/lib/factpulse/models/verification_success_response.rb +1 -1
- data/lib/factpulse/models/verified_field_schema.rb +1 -1
- data/lib/factpulse/version.rb +2 -2
- data/lib/factpulse.rb +34 -3
- metadata +68 -6
|
@@ -0,0 +1,220 @@
|
|
|
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://www.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://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.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://www.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://www.factpulse.fr/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://www.factpulse.fr/documentation-api/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
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
|
+
# Informations sur le type de document detecte.
|
|
18
|
+
class DocumentTypeInfo < ApiModelBase
|
|
19
|
+
# Code UNTDID 1001
|
|
20
|
+
attr_accessor :code
|
|
21
|
+
|
|
22
|
+
# Libelle (Facture, Avoir, etc.)
|
|
23
|
+
attr_accessor :label
|
|
24
|
+
|
|
25
|
+
# Classification interne
|
|
26
|
+
attr_accessor :detected_as
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'code' => :'code',
|
|
32
|
+
:'label' => :'label',
|
|
33
|
+
:'detected_as' => :'detected_as'
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns attribute mapping this model knows about
|
|
38
|
+
def self.acceptable_attribute_map
|
|
39
|
+
attribute_map
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns all the JSON keys this model knows about
|
|
43
|
+
def self.acceptable_attributes
|
|
44
|
+
acceptable_attribute_map.values
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Attribute type mapping.
|
|
48
|
+
def self.openapi_types
|
|
49
|
+
{
|
|
50
|
+
:'code' => :'Integer',
|
|
51
|
+
:'label' => :'String',
|
|
52
|
+
:'detected_as' => :'String'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::DocumentTypeInfo` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::DocumentTypeInfo`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'code')
|
|
79
|
+
self.code = attributes[:'code']
|
|
80
|
+
else
|
|
81
|
+
self.code = nil
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'label')
|
|
85
|
+
self.label = attributes[:'label']
|
|
86
|
+
else
|
|
87
|
+
self.label = nil
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'detected_as')
|
|
91
|
+
self.detected_as = attributes[:'detected_as']
|
|
92
|
+
else
|
|
93
|
+
self.detected_as = nil
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
98
|
+
# @return Array for valid properties with the reasons
|
|
99
|
+
def list_invalid_properties
|
|
100
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
101
|
+
invalid_properties = Array.new
|
|
102
|
+
if @code.nil?
|
|
103
|
+
invalid_properties.push('invalid value for "code", code cannot be nil.')
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if @label.nil?
|
|
107
|
+
invalid_properties.push('invalid value for "label", label cannot be nil.')
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if @detected_as.nil?
|
|
111
|
+
invalid_properties.push('invalid value for "detected_as", detected_as cannot be nil.')
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
invalid_properties
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Check to see if the all the properties in the model are valid
|
|
118
|
+
# @return true if the model is valid
|
|
119
|
+
def valid?
|
|
120
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
121
|
+
return false if @code.nil?
|
|
122
|
+
return false if @label.nil?
|
|
123
|
+
return false if @detected_as.nil?
|
|
124
|
+
true
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Custom attribute writer method with validation
|
|
128
|
+
# @param [Object] code Value to be assigned
|
|
129
|
+
def code=(code)
|
|
130
|
+
if code.nil?
|
|
131
|
+
fail ArgumentError, 'code cannot be nil'
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
@code = code
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Custom attribute writer method with validation
|
|
138
|
+
# @param [Object] label Value to be assigned
|
|
139
|
+
def label=(label)
|
|
140
|
+
if label.nil?
|
|
141
|
+
fail ArgumentError, 'label cannot be nil'
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
@label = label
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Custom attribute writer method with validation
|
|
148
|
+
# @param [Object] detected_as Value to be assigned
|
|
149
|
+
def detected_as=(detected_as)
|
|
150
|
+
if detected_as.nil?
|
|
151
|
+
fail ArgumentError, 'detected_as cannot be nil'
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
@detected_as = detected_as
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Checks equality by comparing each attribute.
|
|
158
|
+
# @param [Object] Object to be compared
|
|
159
|
+
def ==(o)
|
|
160
|
+
return true if self.equal?(o)
|
|
161
|
+
self.class == o.class &&
|
|
162
|
+
code == o.code &&
|
|
163
|
+
label == o.label &&
|
|
164
|
+
detected_as == o.detected_as
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# @see the `==` method
|
|
168
|
+
# @param [Object] Object to be compared
|
|
169
|
+
def eql?(o)
|
|
170
|
+
self == o
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Calculates hash code according to all attributes.
|
|
174
|
+
# @return [Integer] Hash code
|
|
175
|
+
def hash
|
|
176
|
+
[code, label, detected_as].hash
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Builds the object from hash
|
|
180
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
181
|
+
# @return [Object] Returns the model itself
|
|
182
|
+
def self.build_from_hash(attributes)
|
|
183
|
+
return nil unless attributes.is_a?(Hash)
|
|
184
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
185
|
+
transformed_hash = {}
|
|
186
|
+
openapi_types.each_pair do |key, type|
|
|
187
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
188
|
+
transformed_hash["#{key}"] = nil
|
|
189
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
190
|
+
# check to ensure the input is an array given that the attribute
|
|
191
|
+
# is documented as an array but the input is not
|
|
192
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
193
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
194
|
+
end
|
|
195
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
196
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
new(transformed_hash)
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Returns the object in the form of hash
|
|
203
|
+
# @return [Hash] Returns the object in the form of hash
|
|
204
|
+
def to_hash
|
|
205
|
+
hash = {}
|
|
206
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
207
|
+
value = self.send(attr)
|
|
208
|
+
if value.nil?
|
|
209
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
210
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
hash[param] = _to_hash(value)
|
|
214
|
+
end
|
|
215
|
+
hash
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
end
|
|
@@ -0,0 +1,217 @@
|
|
|
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://www.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://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.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://www.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://www.factpulse.fr/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://www.factpulse.fr/documentation-api/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
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
|
+
# Informations sur l'extraction des donnees.
|
|
18
|
+
class ExtractionInfo < ApiModelBase
|
|
19
|
+
# Score de confiance global (0-1)
|
|
20
|
+
attr_accessor :confidence_score
|
|
21
|
+
|
|
22
|
+
# Nombre de champs extraits
|
|
23
|
+
attr_accessor :fields_extracted
|
|
24
|
+
|
|
25
|
+
# Nombre de champs enrichis automatiquement
|
|
26
|
+
attr_accessor :fields_enriched
|
|
27
|
+
|
|
28
|
+
# Nombre de champs manquants
|
|
29
|
+
attr_accessor :fields_missing
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:'confidence_score' => :'confidence_score',
|
|
35
|
+
:'fields_extracted' => :'fields_extracted',
|
|
36
|
+
:'fields_enriched' => :'fields_enriched',
|
|
37
|
+
:'fields_missing' => :'fields_missing'
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns attribute mapping this model knows about
|
|
42
|
+
def self.acceptable_attribute_map
|
|
43
|
+
attribute_map
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Returns all the JSON keys this model knows about
|
|
47
|
+
def self.acceptable_attributes
|
|
48
|
+
acceptable_attribute_map.values
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Attribute type mapping.
|
|
52
|
+
def self.openapi_types
|
|
53
|
+
{
|
|
54
|
+
:'confidence_score' => :'Float',
|
|
55
|
+
:'fields_extracted' => :'Integer',
|
|
56
|
+
:'fields_enriched' => :'Integer',
|
|
57
|
+
:'fields_missing' => :'Integer'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# List of attributes with nullable: true
|
|
62
|
+
def self.openapi_nullable
|
|
63
|
+
Set.new([
|
|
64
|
+
])
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Initializes the object
|
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
69
|
+
def initialize(attributes = {})
|
|
70
|
+
if (!attributes.is_a?(Hash))
|
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::ExtractionInfo` initialize method"
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
75
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
76
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
77
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
78
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::ExtractionInfo`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
79
|
+
end
|
|
80
|
+
h[k.to_sym] = v
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'confidence_score')
|
|
84
|
+
self.confidence_score = attributes[:'confidence_score']
|
|
85
|
+
else
|
|
86
|
+
self.confidence_score = nil
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'fields_extracted')
|
|
90
|
+
self.fields_extracted = attributes[:'fields_extracted']
|
|
91
|
+
else
|
|
92
|
+
self.fields_extracted = nil
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'fields_enriched')
|
|
96
|
+
self.fields_enriched = attributes[:'fields_enriched']
|
|
97
|
+
else
|
|
98
|
+
self.fields_enriched = 0
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'fields_missing')
|
|
102
|
+
self.fields_missing = attributes[:'fields_missing']
|
|
103
|
+
else
|
|
104
|
+
self.fields_missing = 0
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
109
|
+
# @return Array for valid properties with the reasons
|
|
110
|
+
def list_invalid_properties
|
|
111
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
112
|
+
invalid_properties = Array.new
|
|
113
|
+
if @confidence_score.nil?
|
|
114
|
+
invalid_properties.push('invalid value for "confidence_score", confidence_score cannot be nil.')
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if @fields_extracted.nil?
|
|
118
|
+
invalid_properties.push('invalid value for "fields_extracted", fields_extracted cannot be nil.')
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
invalid_properties
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Check to see if the all the properties in the model are valid
|
|
125
|
+
# @return true if the model is valid
|
|
126
|
+
def valid?
|
|
127
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
128
|
+
return false if @confidence_score.nil?
|
|
129
|
+
return false if @fields_extracted.nil?
|
|
130
|
+
true
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Custom attribute writer method with validation
|
|
134
|
+
# @param [Object] confidence_score Value to be assigned
|
|
135
|
+
def confidence_score=(confidence_score)
|
|
136
|
+
if confidence_score.nil?
|
|
137
|
+
fail ArgumentError, 'confidence_score cannot be nil'
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
@confidence_score = confidence_score
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Custom attribute writer method with validation
|
|
144
|
+
# @param [Object] fields_extracted Value to be assigned
|
|
145
|
+
def fields_extracted=(fields_extracted)
|
|
146
|
+
if fields_extracted.nil?
|
|
147
|
+
fail ArgumentError, 'fields_extracted cannot be nil'
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
@fields_extracted = fields_extracted
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Checks equality by comparing each attribute.
|
|
154
|
+
# @param [Object] Object to be compared
|
|
155
|
+
def ==(o)
|
|
156
|
+
return true if self.equal?(o)
|
|
157
|
+
self.class == o.class &&
|
|
158
|
+
confidence_score == o.confidence_score &&
|
|
159
|
+
fields_extracted == o.fields_extracted &&
|
|
160
|
+
fields_enriched == o.fields_enriched &&
|
|
161
|
+
fields_missing == o.fields_missing
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# @see the `==` method
|
|
165
|
+
# @param [Object] Object to be compared
|
|
166
|
+
def eql?(o)
|
|
167
|
+
self == o
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Calculates hash code according to all attributes.
|
|
171
|
+
# @return [Integer] Hash code
|
|
172
|
+
def hash
|
|
173
|
+
[confidence_score, fields_extracted, fields_enriched, fields_missing].hash
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Builds the object from hash
|
|
177
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
178
|
+
# @return [Object] Returns the model itself
|
|
179
|
+
def self.build_from_hash(attributes)
|
|
180
|
+
return nil unless attributes.is_a?(Hash)
|
|
181
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
182
|
+
transformed_hash = {}
|
|
183
|
+
openapi_types.each_pair do |key, type|
|
|
184
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
185
|
+
transformed_hash["#{key}"] = nil
|
|
186
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
187
|
+
# check to ensure the input is an array given that the attribute
|
|
188
|
+
# is documented as an array but the input is not
|
|
189
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
190
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
191
|
+
end
|
|
192
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
193
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
new(transformed_hash)
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Returns the object in the form of hash
|
|
200
|
+
# @return [Hash] Returns the object in the form of hash
|
|
201
|
+
def to_hash
|
|
202
|
+
hash = {}
|
|
203
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
204
|
+
value = self.send(attr)
|
|
205
|
+
if value.nil?
|
|
206
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
207
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
hash[param] = _to_hash(value)
|
|
211
|
+
end
|
|
212
|
+
hash
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
end
|