factpulse 4.1.2 → 4.3.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 (160) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -5
  3. data/Gemfile.lock +2 -2
  4. data/docs/AFNORBasicAuthentication.md +20 -0
  5. data/docs/AFNORCallbackAuthentication.md +49 -0
  6. data/docs/AFNORCallbackHeader.md +20 -0
  7. data/docs/AFNORCallbackParameters.md +24 -0
  8. data/docs/AFNORCallbackSignature.md +20 -0
  9. data/docs/{AFNORFacilityNature.md → AFNORContainsOrStrictOperator.md} +2 -2
  10. data/docs/AFNORCoreFlowInfo.md +26 -0
  11. data/docs/{AFNORDirectoryLinePayloadHistoryLegalUnitFacilityRoutingCode.md → AFNORDirectoryLinePayloadLegalUnitFacilityRoutingCode.md} +5 -5
  12. data/docs/AFNORDirectoryLinePayloadStatusLegalUnitFacilityRoutingCode.md +34 -0
  13. data/docs/AFNORDirectoryLineSearchPost200Response.md +1 -1
  14. data/docs/{AFNORDiffusionStatus.md → AFNORDirectoryLineStatus.md} +2 -2
  15. data/docs/AFNORError.md +4 -4
  16. data/docs/AFNORFacilityPayloadHistory.md +3 -3
  17. data/docs/AFNORFacilityPayloadIncluded.md +0 -2
  18. data/docs/AFNORFlow.md +16 -14
  19. data/docs/AFNORFlowExtension.md +26 -0
  20. data/docs/AFNORFlowInfo.md +3 -3
  21. data/docs/AFNORFlowInfoExtension.md +18 -0
  22. data/docs/AFNORFullFlowInfo.md +8 -8
  23. data/docs/AFNORFullFlowInfoExtension.md +20 -0
  24. data/docs/AFNORLegalUnitPayloadHistory.md +3 -1
  25. data/docs/AFNOROAuth2Authentication.md +22 -0
  26. data/docs/AFNORPDPPADirectoryServiceApi.md +4 -648
  27. data/docs/AFNORPDPPAFlowServiceApi.md +320 -1
  28. data/docs/AFNORRoutingCodeSearch.md +1 -1
  29. data/docs/AFNORRoutingCodeSearchFiltersRoutingCodeName.md +1 -1
  30. data/docs/AFNORRoutingCodeSearchFiltersRoutingIdentifier.md +1 -1
  31. data/docs/AFNORSearchDirectoryLine.md +2 -2
  32. data/docs/AFNORSearchDirectoryLineFiltersAddressingIdentifier.md +1 -1
  33. data/docs/AFNORSearchDirectoryLineFiltersAddressingSuffix.md +1 -1
  34. data/docs/AFNORSearchFlowFilters.md +1 -1
  35. data/docs/AFNORSearchSiren.md +1 -1
  36. data/docs/AFNORSearchSirenFiltersBusinessName.md +1 -1
  37. data/docs/AFNORSearchSirenFiltersSiren.md +1 -1
  38. data/docs/AFNORSearchSiret.md +2 -2
  39. data/docs/AFNORSearchSiretFiltersCountrySubdivision.md +1 -1
  40. data/docs/AFNORSearchSiretFiltersFacilityType.md +1 -1
  41. data/docs/AFNORSearchSiretFiltersLocality.md +1 -1
  42. data/docs/AFNORSearchSiretFiltersName.md +1 -1
  43. data/docs/AFNORSearchSiretFiltersPostalCode.md +1 -1
  44. data/docs/AFNORSearchSiretFiltersSiret.md +1 -1
  45. data/docs/AFNORSirenInstructions.md +18 -0
  46. data/docs/AFNORSiretInstructions.md +18 -0
  47. data/docs/{AFNORPlatformStatus.md → AFNORStrictOrStartWithOperator.md} +2 -2
  48. data/docs/AFNORWebhook.md +22 -0
  49. data/docs/AFNORWebhookIdParam.md +18 -0
  50. data/docs/AFNORWebhookMetadata.md +24 -0
  51. data/docs/AFNORWebhookParams.md +20 -0
  52. data/docs/AFNORWebhookPatchPayload.md +22 -0
  53. data/docs/ChorusProCredentials.md +8 -8
  54. data/docs/ChorusProDestination.md +1 -1
  55. data/docs/FactureElectroniqueRestApiSchemasCdarValidationErrorResponse.md +24 -0
  56. data/docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md +15 -0
  57. data/docs/FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md +26 -0
  58. data/docs/GetChorusProIdRequest.md +1 -1
  59. data/docs/GetInvoiceRequest.md +1 -1
  60. data/docs/GetStructureRequest.md +1 -1
  61. data/docs/InvoiceInput.md +1 -1
  62. data/docs/SearchStructureRequest.md +1 -1
  63. data/docs/SimplifiedInvoiceData.md +1 -1
  64. data/docs/SubmitInvoiceRequest.md +1 -1
  65. data/docs/ValidateCDARResponse.md +2 -2
  66. data/docs/ValidationErrorResponse.md +2 -8
  67. data/lib/factpulse/api/afnorpdppa_directory_service_api.rb +3 -621
  68. data/lib/factpulse/api/afnorpdppa_flow_service_api.rb +303 -0
  69. data/lib/factpulse/models/afnor_algorithm.rb +4 -3
  70. data/lib/factpulse/models/afnor_basic_authentication.rb +190 -0
  71. data/lib/factpulse/models/afnor_callback_authentication.rb +105 -0
  72. data/lib/factpulse/models/afnor_callback_header.rb +190 -0
  73. data/lib/factpulse/models/afnor_callback_parameters.rb +193 -0
  74. data/lib/factpulse/models/{afnor_directory_line_payload_history_legal_unit_facility_routing_code_platform.rb → afnor_callback_signature.rb} +51 -16
  75. data/lib/factpulse/models/{afnor_diffusion_status.rb → afnor_contains_or_strict_operator.rb} +6 -6
  76. data/lib/factpulse/models/{afnor_routing_code_post201_response.rb → afnor_core_flow_info.rb} +103 -61
  77. data/lib/factpulse/models/afnor_directory_line_field.rb +1 -2
  78. data/lib/factpulse/models/{afnor_directory_line_payload_history_legal_unit_facility_routing_code.rb → afnor_directory_line_payload_legal_unit_facility_routing_code.rb} +36 -14
  79. data/lib/factpulse/models/{afnor_create_directory_line_body_addressing_information.rb → afnor_directory_line_payload_status_legal_unit_facility_routing_code.rb} +105 -56
  80. data/lib/factpulse/models/afnor_directory_line_search_post200_response.rb +1 -1
  81. data/lib/factpulse/models/{afnor_platform_status.rb → afnor_directory_line_status.rb} +5 -4
  82. data/lib/factpulse/models/afnor_error.rb +30 -39
  83. data/lib/factpulse/models/afnor_facility_payload_history.rb +11 -11
  84. data/lib/factpulse/models/afnor_facility_payload_included.rb +1 -10
  85. data/lib/factpulse/models/afnor_flow.rb +218 -57
  86. data/lib/factpulse/models/{afnor_update_patch_routing_code_body.rb → afnor_flow_extension.rb} +103 -66
  87. data/lib/factpulse/models/afnor_flow_info.rb +20 -4
  88. data/lib/factpulse/models/{afnor_create_directory_line_body_period.rb → afnor_flow_info_extension.rb} +26 -31
  89. data/lib/factpulse/models/afnor_full_flow_info.rb +79 -46
  90. data/lib/factpulse/models/afnor_full_flow_info_extension.rb +202 -0
  91. data/lib/factpulse/models/afnor_legal_unit_payload_history.rb +13 -4
  92. data/lib/factpulse/models/afnor_processing_rule.rb +4 -1
  93. data/lib/factpulse/models/afnor_routing_code_field.rb +1 -2
  94. data/lib/factpulse/models/afnor_routing_code_search_filters_routing_code_name.rb +1 -1
  95. data/lib/factpulse/models/afnor_routing_code_search_filters_routing_identifier.rb +1 -1
  96. data/lib/factpulse/models/afnor_search_directory_line_filters_addressing_identifier.rb +1 -1
  97. data/lib/factpulse/models/afnor_search_directory_line_filters_addressing_suffix.rb +1 -1
  98. data/lib/factpulse/models/afnor_search_flow_filters.rb +1 -0
  99. data/lib/factpulse/models/afnor_search_siren_filters_business_name.rb +1 -1
  100. data/lib/factpulse/models/afnor_search_siren_filters_siren.rb +1 -1
  101. data/lib/factpulse/models/afnor_search_siret_filters_country_subdivision.rb +1 -1
  102. data/lib/factpulse/models/afnor_search_siret_filters_facility_type.rb +1 -1
  103. data/lib/factpulse/models/afnor_search_siret_filters_locality.rb +1 -1
  104. data/lib/factpulse/models/afnor_search_siret_filters_name.rb +1 -1
  105. data/lib/factpulse/models/afnor_search_siret_filters_postal_code.rb +1 -1
  106. data/lib/factpulse/models/afnor_search_siret_filters_siret.rb +1 -1
  107. data/lib/factpulse/models/afnor_siren_field.rb +2 -2
  108. data/lib/factpulse/models/{afnor_update_patch_directory_line_body.rb → afnor_siren_instructions.rb} +12 -11
  109. data/lib/factpulse/models/afnor_siret_field.rb +3 -4
  110. data/lib/factpulse/models/{afnor_create_directory_line_body.rb → afnor_siret_instructions.rb} +12 -19
  111. data/lib/factpulse/models/{afnor_facility_nature.rb → afnor_strict_or_start_with_operator.rb} +6 -6
  112. data/lib/factpulse/models/{afnor_directory_line_post201_response.rb → afnor_webhook.rb} +55 -35
  113. data/lib/factpulse/models/{afnor_webhook_callback_content.rb → afnor_webhook_id_param.rb} +10 -11
  114. data/lib/factpulse/models/{afnor_legal_unit_payload_included_no_siren.rb → afnor_webhook_metadata.rb} +56 -33
  115. data/lib/factpulse/models/afnor_webhook_params.rb +190 -0
  116. data/lib/factpulse/models/{facture_electronique_rest_api_schemas_validation_validation_error_response.rb → afnor_webhook_patch_payload.rb} +29 -30
  117. data/lib/factpulse/models/afnoro_auth2_authentication.rb +216 -0
  118. data/lib/factpulse/models/chorus_pro_credentials.rb +94 -26
  119. data/lib/factpulse/models/chorus_pro_destination.rb +1 -1
  120. data/lib/factpulse/models/facture_electronique_rest_api_schemas_cdar_validation_error_response.rb +215 -0
  121. data/lib/factpulse/models/{facture_electronique_models_invoice_type_code.rb → facture_electronique_rest_api_schemas_ereporting_invoice_type_code.rb} +9 -20
  122. data/lib/factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb +191 -0
  123. data/lib/factpulse/models/get_chorus_pro_id_request.rb +1 -1
  124. data/lib/factpulse/models/get_invoice_request.rb +1 -1
  125. data/lib/factpulse/models/get_structure_request.rb +1 -1
  126. data/lib/factpulse/models/invoice_input.rb +1 -1
  127. data/lib/factpulse/models/invoice_type_code.rb +17 -6
  128. data/lib/factpulse/models/processing_rule.rb +4 -1
  129. data/lib/factpulse/models/search_structure_request.rb +1 -1
  130. data/lib/factpulse/models/simplified_invoice_data.rb +1 -1
  131. data/lib/factpulse/models/submit_invoice_request.rb +1 -1
  132. data/lib/factpulse/models/validate_cdar_response.rb +2 -2
  133. data/lib/factpulse/models/validation_error_response.rb +20 -67
  134. data/lib/factpulse/version.rb +1 -1
  135. data/lib/factpulse.rb +25 -22
  136. metadata +52 -46
  137. data/docs/AFNORAddressEdit.md +0 -30
  138. data/docs/AFNORAddressPatch.md +0 -30
  139. data/docs/AFNORAddressPut.md +0 -30
  140. data/docs/AFNORCreateDirectoryLineBody.md +0 -20
  141. data/docs/AFNORCreateDirectoryLineBodyAddressingInformation.md +0 -24
  142. data/docs/AFNORCreateDirectoryLineBodyPeriod.md +0 -20
  143. data/docs/AFNORCreateRoutingCodeBody.md +0 -32
  144. data/docs/AFNORDirectoryLinePayloadHistoryLegalUnitFacilityRoutingCodePlatform.md +0 -20
  145. data/docs/AFNORDirectoryLinePost201Response.md +0 -22
  146. data/docs/AFNORLegalUnitPayloadIncludedNoSiren.md +0 -22
  147. data/docs/AFNORRoutingCodePost201Response.md +0 -22
  148. data/docs/AFNORUpdatePatchDirectoryLineBody.md +0 -18
  149. data/docs/AFNORUpdatePatchRoutingCodeBody.md +0 -24
  150. data/docs/AFNORUpdatePutRoutingCodeBody.md +0 -24
  151. data/docs/AFNORWebhookCallbackContent.md +0 -18
  152. data/docs/FactureElectroniqueModelsInvoiceTypeCode.md +0 -15
  153. data/docs/FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md +0 -26
  154. data/docs/FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.md +0 -18
  155. data/lib/factpulse/models/afnor_address_edit.rb +0 -353
  156. data/lib/factpulse/models/afnor_address_patch.rb +0 -386
  157. data/lib/factpulse/models/afnor_address_put.rb +0 -435
  158. data/lib/factpulse/models/afnor_create_routing_code_body.rb +0 -412
  159. data/lib/factpulse/models/afnor_update_put_routing_code_body.rb +0 -289
  160. data/lib/factpulse/models/facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.rb +0 -259
@@ -0,0 +1,216 @@
1
+ =begin
2
+ #FactPulse REST API
3
+
4
+ # REST API for electronic invoicing in France: Factur-X (CII), UBL 2.1, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Invoice Generation - **Formats**: CII XML, UBL 2.1 XML, or Factur-X PDF/A-3 - **Profiles** (CII/PDF): MINIMUM, BASIC, EN16931, EXTENDED - **UBL**: Always EN16931 compliant - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT), UBL 2.1 (OASIS) - **Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Factur-X - Validation - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) ### ✍️ 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 ### 📋 Flux 6 - Invoice Lifecycle (CDAR) - **CDAR Messages**: Acknowledgements, invoice statuses - **PPF Statuses**: REFUSED (210), PAID (212) ### 📊 Flux 10 - E-Reporting - **Tax Declarations**: International B2B, B2C - **Flow Types**: 10.1 (B2B transactions), 10.2 (B2B payments), 10.3 (B2C transactions), 10.4 (B2C payments) ### 📡 AFNOR PDP/PA (XP Z12-013) - **Flow Service**: Submit and search flows to PDPs - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user ### 🏛️ Chorus Pro - **Public Sector Invoicing**: Complete API for Chorus Pro ### ⏳ Async Tasks - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **Webhooks**: Automatic notifications when tasks complete ## 🔒 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.21.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ class AFNOROAuth2Authentication < ApiModelBase
18
+ attr_accessor :token_url
19
+
20
+ attr_accessor :client_id
21
+
22
+ attr_accessor :client_secret
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'token_url' => :'tokenUrl',
28
+ :'client_id' => :'clientId',
29
+ :'client_secret' => :'clientSecret'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'token_url' => :'String',
47
+ :'client_id' => :'String',
48
+ :'client_secret' => :'String'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::AFNOROAuth2Authentication` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::AFNOROAuth2Authentication`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'token_url')
75
+ self.token_url = attributes[:'token_url']
76
+ else
77
+ self.token_url = nil
78
+ end
79
+
80
+ if attributes.key?(:'client_id')
81
+ self.client_id = attributes[:'client_id']
82
+ else
83
+ self.client_id = nil
84
+ end
85
+
86
+ if attributes.key?(:'client_secret')
87
+ self.client_secret = attributes[:'client_secret']
88
+ else
89
+ self.client_secret = nil
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
+ invalid_properties = Array.new
98
+ if @token_url.nil?
99
+ invalid_properties.push('invalid value for "token_url", token_url cannot be nil.')
100
+ end
101
+
102
+ if @client_id.nil?
103
+ invalid_properties.push('invalid value for "client_id", client_id cannot be nil.')
104
+ end
105
+
106
+ if @client_secret.nil?
107
+ invalid_properties.push('invalid value for "client_secret", client_secret cannot be nil.')
108
+ end
109
+
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ warn '[DEPRECATED] the `valid?` method is obsolete'
117
+ return false if @token_url.nil?
118
+ return false if @client_id.nil?
119
+ return false if @client_secret.nil?
120
+ true
121
+ end
122
+
123
+ # Custom attribute writer method with validation
124
+ # @param [Object] token_url Value to be assigned
125
+ def token_url=(token_url)
126
+ if token_url.nil?
127
+ fail ArgumentError, 'token_url cannot be nil'
128
+ end
129
+
130
+ @token_url = token_url
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] client_id Value to be assigned
135
+ def client_id=(client_id)
136
+ if client_id.nil?
137
+ fail ArgumentError, 'client_id cannot be nil'
138
+ end
139
+
140
+ @client_id = client_id
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] client_secret Value to be assigned
145
+ def client_secret=(client_secret)
146
+ if client_secret.nil?
147
+ fail ArgumentError, 'client_secret cannot be nil'
148
+ end
149
+
150
+ @client_secret = client_secret
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
+ token_url == o.token_url &&
159
+ client_id == o.client_id &&
160
+ client_secret == o.client_secret
161
+ end
162
+
163
+ # @see the `==` method
164
+ # @param [Object] Object to be compared
165
+ def eql?(o)
166
+ self == o
167
+ end
168
+
169
+ # Calculates hash code according to all attributes.
170
+ # @return [Integer] Hash code
171
+ def hash
172
+ [token_url, client_id, client_secret].hash
173
+ end
174
+
175
+ # Builds the object from hash
176
+ # @param [Hash] attributes Model attributes in the form of hash
177
+ # @return [Object] Returns the model itself
178
+ def self.build_from_hash(attributes)
179
+ return nil unless attributes.is_a?(Hash)
180
+ attributes = attributes.transform_keys(&:to_sym)
181
+ transformed_hash = {}
182
+ openapi_types.each_pair do |key, type|
183
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = nil
185
+ elsif type =~ /\AArray<(.*)>/i
186
+ # check to ensure the input is an array given that the attribute
187
+ # is documented as an array but the input is not
188
+ if attributes[attribute_map[key]].is_a?(Array)
189
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
190
+ end
191
+ elsif !attributes[attribute_map[key]].nil?
192
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
193
+ end
194
+ end
195
+ new(transformed_hash)
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ end
215
+
216
+ end
@@ -14,27 +14,31 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module FactPulse
17
- # Optional Chorus Pro credentials. **MODE 1 - JWT retrieval (recommended):** Do not provide this `credentials` field in the payload. Credentials will be automatically retrieved via client_uid from JWT (0-trust). **MODE 2 - Credentials in payload:** Provide all required fields below. Useful for tests or third-party integrations.
17
+ # Chorus Pro credentials for Zero-Trust mode. **Zero-Trust Mode**: Credentials are passed in each request and are NEVER stored. **Security**: - Credentials are never persisted in the database - They are used only for the duration of the request - Secure transmission via HTTPS **Use cases**: - High-security environments (banks, administrations) - Strict GDPR compliance - Tests with temporary credentials - Users who don't want to store their credentials
18
18
  class ChorusProCredentials < ApiModelBase
19
+ # PISTE Client ID (government API portal)
19
20
  attr_accessor :piste_client_id
20
21
 
22
+ # PISTE Client Secret
21
23
  attr_accessor :piste_client_secret
22
24
 
23
- attr_accessor :chorus_login
25
+ # Chorus Pro login
26
+ attr_accessor :chorus_pro_login
24
27
 
25
- attr_accessor :chorus_password
28
+ # Chorus Pro password
29
+ attr_accessor :chorus_pro_password
26
30
 
27
- # [MODE 2] Use sandbox mode (default: True)
28
- attr_accessor :sandbox_mode
31
+ # Use sandbox environment (true) or production (false)
32
+ attr_accessor :sandbox
29
33
 
30
34
  # Attribute mapping from ruby-style variable name to JSON key.
31
35
  def self.attribute_map
32
36
  {
33
37
  :'piste_client_id' => :'pisteClientId',
34
38
  :'piste_client_secret' => :'pisteClientSecret',
35
- :'chorus_login' => :'chorusLogin',
36
- :'chorus_password' => :'chorusPassword',
37
- :'sandbox_mode' => :'sandboxMode'
39
+ :'chorus_pro_login' => :'chorusProLogin',
40
+ :'chorus_pro_password' => :'chorusProPassword',
41
+ :'sandbox' => :'sandbox'
38
42
  }
39
43
  end
40
44
 
@@ -53,19 +57,15 @@ module FactPulse
53
57
  {
54
58
  :'piste_client_id' => :'String',
55
59
  :'piste_client_secret' => :'String',
56
- :'chorus_login' => :'String',
57
- :'chorus_password' => :'String',
58
- :'sandbox_mode' => :'Boolean'
60
+ :'chorus_pro_login' => :'String',
61
+ :'chorus_pro_password' => :'String',
62
+ :'sandbox' => :'Boolean'
59
63
  }
60
64
  end
61
65
 
62
66
  # List of attributes with nullable: true
63
67
  def self.openapi_nullable
64
68
  Set.new([
65
- :'piste_client_id',
66
- :'piste_client_secret',
67
- :'chorus_login',
68
- :'chorus_password',
69
69
  ])
70
70
  end
71
71
 
@@ -87,24 +87,32 @@ module FactPulse
87
87
 
88
88
  if attributes.key?(:'piste_client_id')
89
89
  self.piste_client_id = attributes[:'piste_client_id']
90
+ else
91
+ self.piste_client_id = nil
90
92
  end
91
93
 
92
94
  if attributes.key?(:'piste_client_secret')
93
95
  self.piste_client_secret = attributes[:'piste_client_secret']
96
+ else
97
+ self.piste_client_secret = nil
94
98
  end
95
99
 
96
- if attributes.key?(:'chorus_login')
97
- self.chorus_login = attributes[:'chorus_login']
100
+ if attributes.key?(:'chorus_pro_login')
101
+ self.chorus_pro_login = attributes[:'chorus_pro_login']
102
+ else
103
+ self.chorus_pro_login = nil
98
104
  end
99
105
 
100
- if attributes.key?(:'chorus_password')
101
- self.chorus_password = attributes[:'chorus_password']
106
+ if attributes.key?(:'chorus_pro_password')
107
+ self.chorus_pro_password = attributes[:'chorus_pro_password']
108
+ else
109
+ self.chorus_pro_password = nil
102
110
  end
103
111
 
104
- if attributes.key?(:'sandbox_mode')
105
- self.sandbox_mode = attributes[:'sandbox_mode']
112
+ if attributes.key?(:'sandbox')
113
+ self.sandbox = attributes[:'sandbox']
106
114
  else
107
- self.sandbox_mode = true
115
+ self.sandbox = true
108
116
  end
109
117
  end
110
118
 
@@ -113,6 +121,22 @@ module FactPulse
113
121
  def list_invalid_properties
114
122
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
115
123
  invalid_properties = Array.new
124
+ if @piste_client_id.nil?
125
+ invalid_properties.push('invalid value for "piste_client_id", piste_client_id cannot be nil.')
126
+ end
127
+
128
+ if @piste_client_secret.nil?
129
+ invalid_properties.push('invalid value for "piste_client_secret", piste_client_secret cannot be nil.')
130
+ end
131
+
132
+ if @chorus_pro_login.nil?
133
+ invalid_properties.push('invalid value for "chorus_pro_login", chorus_pro_login cannot be nil.')
134
+ end
135
+
136
+ if @chorus_pro_password.nil?
137
+ invalid_properties.push('invalid value for "chorus_pro_password", chorus_pro_password cannot be nil.')
138
+ end
139
+
116
140
  invalid_properties
117
141
  end
118
142
 
@@ -120,9 +144,53 @@ module FactPulse
120
144
  # @return true if the model is valid
121
145
  def valid?
122
146
  warn '[DEPRECATED] the `valid?` method is obsolete'
147
+ return false if @piste_client_id.nil?
148
+ return false if @piste_client_secret.nil?
149
+ return false if @chorus_pro_login.nil?
150
+ return false if @chorus_pro_password.nil?
123
151
  true
124
152
  end
125
153
 
154
+ # Custom attribute writer method with validation
155
+ # @param [Object] piste_client_id Value to be assigned
156
+ def piste_client_id=(piste_client_id)
157
+ if piste_client_id.nil?
158
+ fail ArgumentError, 'piste_client_id cannot be nil'
159
+ end
160
+
161
+ @piste_client_id = piste_client_id
162
+ end
163
+
164
+ # Custom attribute writer method with validation
165
+ # @param [Object] piste_client_secret Value to be assigned
166
+ def piste_client_secret=(piste_client_secret)
167
+ if piste_client_secret.nil?
168
+ fail ArgumentError, 'piste_client_secret cannot be nil'
169
+ end
170
+
171
+ @piste_client_secret = piste_client_secret
172
+ end
173
+
174
+ # Custom attribute writer method with validation
175
+ # @param [Object] chorus_pro_login Value to be assigned
176
+ def chorus_pro_login=(chorus_pro_login)
177
+ if chorus_pro_login.nil?
178
+ fail ArgumentError, 'chorus_pro_login cannot be nil'
179
+ end
180
+
181
+ @chorus_pro_login = chorus_pro_login
182
+ end
183
+
184
+ # Custom attribute writer method with validation
185
+ # @param [Object] chorus_pro_password Value to be assigned
186
+ def chorus_pro_password=(chorus_pro_password)
187
+ if chorus_pro_password.nil?
188
+ fail ArgumentError, 'chorus_pro_password cannot be nil'
189
+ end
190
+
191
+ @chorus_pro_password = chorus_pro_password
192
+ end
193
+
126
194
  # Checks equality by comparing each attribute.
127
195
  # @param [Object] Object to be compared
128
196
  def ==(o)
@@ -130,9 +198,9 @@ module FactPulse
130
198
  self.class == o.class &&
131
199
  piste_client_id == o.piste_client_id &&
132
200
  piste_client_secret == o.piste_client_secret &&
133
- chorus_login == o.chorus_login &&
134
- chorus_password == o.chorus_password &&
135
- sandbox_mode == o.sandbox_mode
201
+ chorus_pro_login == o.chorus_pro_login &&
202
+ chorus_pro_password == o.chorus_pro_password &&
203
+ sandbox == o.sandbox
136
204
  end
137
205
 
138
206
  # @see the `==` method
@@ -144,7 +212,7 @@ module FactPulse
144
212
  # Calculates hash code according to all attributes.
145
213
  # @return [Integer] Hash code
146
214
  def hash
147
- [piste_client_id, piste_client_secret, chorus_login, chorus_password, sandbox_mode].hash
215
+ [piste_client_id, piste_client_secret, chorus_pro_login, chorus_pro_password, sandbox].hash
148
216
  end
149
217
 
150
218
  # Builds the object from hash
@@ -64,7 +64,7 @@ module FactPulse
64
64
  def self.openapi_types
65
65
  {
66
66
  :'type' => :'String',
67
- :'credentials' => :'ChorusProCredentials'
67
+ :'credentials' => :'FactureElectroniqueRestApiSchemasProcessingChorusProCredentials'
68
68
  }
69
69
  end
70
70
 
@@ -0,0 +1,215 @@
1
+ =begin
2
+ #FactPulse REST API
3
+
4
+ # REST API for electronic invoicing in France: Factur-X (CII), UBL 2.1, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Invoice Generation - **Formats**: CII XML, UBL 2.1 XML, or Factur-X PDF/A-3 - **Profiles** (CII/PDF): MINIMUM, BASIC, EN16931, EXTENDED - **UBL**: Always EN16931 compliant - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT), UBL 2.1 (OASIS) - **Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Factur-X - Validation - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) ### ✍️ 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 ### 📋 Flux 6 - Invoice Lifecycle (CDAR) - **CDAR Messages**: Acknowledgements, invoice statuses - **PPF Statuses**: REFUSED (210), PAID (212) ### 📊 Flux 10 - E-Reporting - **Tax Declarations**: International B2B, B2C - **Flow Types**: 10.1 (B2B transactions), 10.2 (B2B payments), 10.3 (B2C transactions), 10.4 (B2C payments) ### 📡 AFNOR PDP/PA (XP Z12-013) - **Flow Service**: Submit and search flows to PDPs - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user ### 🏛️ Chorus Pro - **Public Sector Invoicing**: Complete API for Chorus Pro ### ⏳ Async Tasks - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **Webhooks**: Automatic notifications when tasks complete ## 🔒 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.21.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ # Erreur de validation.
18
+ class FactureElectroniqueRestApiSchemasCdarValidationErrorResponse < ApiModelBase
19
+ # Champ concerné
20
+ attr_accessor :field
21
+
22
+ # Message d'erreur
23
+ attr_accessor :message
24
+
25
+ attr_accessor :rule
26
+
27
+ # Sévérité (error/warning)
28
+ attr_accessor :severity
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'field' => :'field',
34
+ :'message' => :'message',
35
+ :'rule' => :'rule',
36
+ :'severity' => :'severity'
37
+ }
38
+ end
39
+
40
+ # Returns attribute mapping this model knows about
41
+ def self.acceptable_attribute_map
42
+ attribute_map
43
+ end
44
+
45
+ # Returns all the JSON keys this model knows about
46
+ def self.acceptable_attributes
47
+ acceptable_attribute_map.values
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'field' => :'String',
54
+ :'message' => :'String',
55
+ :'rule' => :'String',
56
+ :'severity' => :'String'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ :'rule',
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::FactureElectroniqueRestApiSchemasCdarValidationErrorResponse` 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::FactureElectroniqueRestApiSchemasCdarValidationErrorResponse`. 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?(:'field')
84
+ self.field = attributes[:'field']
85
+ else
86
+ self.field = nil
87
+ end
88
+
89
+ if attributes.key?(:'message')
90
+ self.message = attributes[:'message']
91
+ else
92
+ self.message = nil
93
+ end
94
+
95
+ if attributes.key?(:'rule')
96
+ self.rule = attributes[:'rule']
97
+ end
98
+
99
+ if attributes.key?(:'severity')
100
+ self.severity = attributes[:'severity']
101
+ else
102
+ self.severity = 'error'
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
110
+ invalid_properties = Array.new
111
+ if @field.nil?
112
+ invalid_properties.push('invalid value for "field", field cannot be nil.')
113
+ end
114
+
115
+ if @message.nil?
116
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
117
+ end
118
+
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ warn '[DEPRECATED] the `valid?` method is obsolete'
126
+ return false if @field.nil?
127
+ return false if @message.nil?
128
+ true
129
+ end
130
+
131
+ # Custom attribute writer method with validation
132
+ # @param [Object] field Value to be assigned
133
+ def field=(field)
134
+ if field.nil?
135
+ fail ArgumentError, 'field cannot be nil'
136
+ end
137
+
138
+ @field = field
139
+ end
140
+
141
+ # Custom attribute writer method with validation
142
+ # @param [Object] message Value to be assigned
143
+ def message=(message)
144
+ if message.nil?
145
+ fail ArgumentError, 'message cannot be nil'
146
+ end
147
+
148
+ @message = message
149
+ end
150
+
151
+ # Checks equality by comparing each attribute.
152
+ # @param [Object] Object to be compared
153
+ def ==(o)
154
+ return true if self.equal?(o)
155
+ self.class == o.class &&
156
+ field == o.field &&
157
+ message == o.message &&
158
+ rule == o.rule &&
159
+ severity == o.severity
160
+ end
161
+
162
+ # @see the `==` method
163
+ # @param [Object] Object to be compared
164
+ def eql?(o)
165
+ self == o
166
+ end
167
+
168
+ # Calculates hash code according to all attributes.
169
+ # @return [Integer] Hash code
170
+ def hash
171
+ [field, message, rule, severity].hash
172
+ end
173
+
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
177
+ def self.build_from_hash(attributes)
178
+ return nil unless attributes.is_a?(Hash)
179
+ attributes = attributes.transform_keys(&:to_sym)
180
+ transformed_hash = {}
181
+ openapi_types.each_pair do |key, type|
182
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
183
+ transformed_hash["#{key}"] = nil
184
+ elsif type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[attribute_map[key]].is_a?(Array)
188
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
189
+ end
190
+ elsif !attributes[attribute_map[key]].nil?
191
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
192
+ end
193
+ end
194
+ new(transformed_hash)
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ if value.nil?
204
+ is_nullable = self.class.openapi_nullable.include?(attr)
205
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
206
+ end
207
+
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ end
214
+
215
+ end