factpulse 2.0.30 → 2.0.31

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78ca875881399d5d04602d4298a5fee55f3f7249fa347fe10e7aeb2fcb0dfd9d
4
- data.tar.gz: b6ec7a089da11bc8b23e5aa4d181c027b7195f4e1c55c7ef9c5e7c06104831e4
3
+ metadata.gz: 9a2fa7a0aa8a73b2298393f60b15772a3dd178966bf49d1781432466a3394e2a
4
+ data.tar.gz: 41533e0cd8bd3b2871fe5d57f48e1bc5a01d6524b58e76768e8984eb613c3b94
5
5
  SHA512:
6
- metadata.gz: 1c0ed4f46576b6b09ce2751926b947fad1a6200cb42c4c5f725df79984530b7c507761ed9fdef006671517749fce5f3f3bb327c4b0d67f1f244fb2d3f1787f93
7
- data.tar.gz: e5ab5b82a5eb675daa30dbb8e129ba468616c41126ec5ee9aa17d7d907a4c17565472a86f513dfe456113de53b5adf005106200a7775348b52e045d69c74aadc
6
+ metadata.gz: 8be71e97dcd09c3d3d3ee790ab76e0ffb3ba5e06c53fa018582500856df15675b20b4230a2afc8090091e79560d40b2a57885313c734507f90f40d8f32ac25a9
7
+ data.tar.gz: b85c744af81489afe834d1e181f46244285ec0ddc58d6a885d3e86945c7ba6a5f300195e12aee1bac4f6a31d419c7174c6509754952c4ed56ad3d3afdcb9db49
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
- ## [2.0.30] - 2025-11-29
10
+ ## [2.0.31] - 2025-11-29
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/v2.0.30...HEAD
28
- [2.0.30]: https://github.com/factpulse/sdk-ruby/releases/tag/v2.0.30
27
+ [Unreleased]: https://github.com/factpulse/sdk-ruby/compare/v2.0.31...HEAD
28
+ [2.0.31]: https://github.com/factpulse/sdk-ruby/releases/tag/v2.0.31
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- factpulse (2.0.30)
4
+ factpulse (2.0.31)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -5,6 +5,7 @@ All URIs are relative to *http://localhost*
5
5
  | Method | HTTP request | Description |
6
6
  | ------ | ------------ | ----------- |
7
7
  | [**get_afnor_credentials_api_v1_afnor_credentials_get**](AFNORPDPPAApi.md#get_afnor_credentials_api_v1_afnor_credentials_get) | **GET** /api/v1/afnor/credentials | Récupérer les credentials AFNOR stockés |
8
+ | [**get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get**](AFNORPDPPAApi.md#get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get) | **GET** /api/v1/afnor/flux-entrants/{flow_id} | Récupérer et extraire une facture entrante |
8
9
  | [**oauth_token_proxy_api_v1_afnor_oauth_token_post**](AFNORPDPPAApi.md#oauth_token_proxy_api_v1_afnor_oauth_token_post) | **POST** /api/v1/afnor/oauth/token | Endpoint OAuth2 pour authentification AFNOR |
9
10
 
10
11
 
@@ -74,6 +75,75 @@ This endpoint does not need any parameter.
74
75
  - **Accept**: application/json
75
76
 
76
77
 
78
+ ## get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get
79
+
80
+ > <FactureEntrante> get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get(flow_id)
81
+
82
+ Récupérer et extraire une facture entrante
83
+
84
+ Télécharge un flux entrant depuis la PDP AFNOR et extrait les métadonnées de la facture vers un format JSON unifié. Supporte les formats Factur-X, CII et UBL.
85
+
86
+ ### Examples
87
+
88
+ ```ruby
89
+ require 'time'
90
+ require 'factpulse'
91
+ # setup authorization
92
+ FactPulse.configure do |config|
93
+ # Configure Bearer authorization: HTTPBearer
94
+ config.access_token = 'YOUR_BEARER_TOKEN'
95
+ end
96
+
97
+ api_instance = FactPulse::AFNORPDPPAApi.new
98
+ flow_id = 'flow_id_example' # String |
99
+
100
+ begin
101
+ # Récupérer et extraire une facture entrante
102
+ result = api_instance.get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get(flow_id)
103
+ p result
104
+ rescue FactPulse::ApiError => e
105
+ puts "Error when calling AFNORPDPPAApi->get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get: #{e}"
106
+ end
107
+ ```
108
+
109
+ #### Using the get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get_with_http_info variant
110
+
111
+ This returns an Array which contains the response data, status code and headers.
112
+
113
+ > <Array(<FactureEntrante>, Integer, Hash)> get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get_with_http_info(flow_id)
114
+
115
+ ```ruby
116
+ begin
117
+ # Récupérer et extraire une facture entrante
118
+ data, status_code, headers = api_instance.get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get_with_http_info(flow_id)
119
+ p status_code # => 2xx
120
+ p headers # => { ... }
121
+ p data # => <FactureEntrante>
122
+ rescue FactPulse::ApiError => e
123
+ puts "Error when calling AFNORPDPPAApi->get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get_with_http_info: #{e}"
124
+ end
125
+ ```
126
+
127
+ ### Parameters
128
+
129
+ | Name | Type | Description | Notes |
130
+ | ---- | ---- | ----------- | ----- |
131
+ | **flow_id** | **String** | | |
132
+
133
+ ### Return type
134
+
135
+ [**FactureEntrante**](FactureEntrante.md)
136
+
137
+ ### Authorization
138
+
139
+ [HTTPBearer](../README.md#HTTPBearer)
140
+
141
+ ### HTTP request headers
142
+
143
+ - **Content-Type**: Not defined
144
+ - **Accept**: application/json
145
+
146
+
77
147
  ## oauth_token_proxy_api_v1_afnor_oauth_token_post
78
148
 
79
149
  > Object oauth_token_proxy_api_v1_afnor_oauth_token_post
@@ -0,0 +1,48 @@
1
+ # FactPulse::FactureEntrante
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **flow_id** | **String** | | [optional] |
8
+ | **format_source** | [**FormatFacture**](FormatFacture.md) | Format source de la facture | |
9
+ | **ref_fournisseur** | **String** | Numéro de facture émis par le fournisseur (BT-1) | |
10
+ | **type_document** | [**TypeDocument**](TypeDocument.md) | Type de document (BT-3) | [optional] |
11
+ | **fournisseur** | [**FournisseurEntrant**](FournisseurEntrant.md) | Émetteur de la facture (SellerTradeParty) | |
12
+ | **site_facturation_nom** | **String** | Nom du destinataire / votre entreprise (BT-44) | |
13
+ | **site_facturation_siret** | **String** | | [optional] |
14
+ | **date_de_piece** | **String** | Date de la facture (BT-2) - YYYY-MM-DD | |
15
+ | **date_reglement** | **String** | | [optional] |
16
+ | **devise** | **String** | Code devise ISO (BT-5) | [optional][default to &#39;EUR&#39;] |
17
+ | **montant_ht** | **String** | Montant HT total (BT-109) | |
18
+ | **montant_tva** | **String** | Montant TVA total (BT-110) | |
19
+ | **montant_ttc** | **String** | Montant TTC total (BT-112) | |
20
+ | **numero_bon_commande** | **String** | | [optional] |
21
+ | **reference_contrat** | **String** | | [optional] |
22
+ | **objet_facture** | **String** | | [optional] |
23
+
24
+ ## Example
25
+
26
+ ```ruby
27
+ require 'factpulse'
28
+
29
+ instance = FactPulse::FactureEntrante.new(
30
+ flow_id: null,
31
+ format_source: null,
32
+ ref_fournisseur: null,
33
+ type_document: null,
34
+ fournisseur: null,
35
+ site_facturation_nom: null,
36
+ site_facturation_siret: null,
37
+ date_de_piece: null,
38
+ date_reglement: null,
39
+ devise: null,
40
+ montant_ht: null,
41
+ montant_tva: null,
42
+ montant_ttc: null,
43
+ numero_bon_commande: null,
44
+ reference_contrat: null,
45
+ objet_facture: null
46
+ )
47
+ ```
48
+
@@ -0,0 +1,15 @@
1
+ # FactPulse::FormatFacture
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+
8
+ ## Example
9
+
10
+ ```ruby
11
+ require 'factpulse'
12
+
13
+ instance = FactPulse::FormatFacture.new()
14
+ ```
15
+
@@ -0,0 +1,32 @@
1
+ # FactPulse::FournisseurEntrant
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **nom** | **String** | Raison sociale du fournisseur (BT-27) | |
8
+ | **siren** | **String** | | [optional] |
9
+ | **siret** | **String** | | [optional] |
10
+ | **numero_tva_intra** | **String** | | [optional] |
11
+ | **adresse_postale** | [**AdressePostale**](AdressePostale.md) | | [optional] |
12
+ | **adresse_electronique** | [**AdresseElectronique**](AdresseElectronique.md) | | [optional] |
13
+ | **email** | **String** | | [optional] |
14
+ | **telephone** | **String** | | [optional] |
15
+
16
+ ## Example
17
+
18
+ ```ruby
19
+ require 'factpulse'
20
+
21
+ instance = FactPulse::FournisseurEntrant.new(
22
+ nom: null,
23
+ siren: null,
24
+ siret: null,
25
+ numero_tva_intra: null,
26
+ adresse_postale: null,
27
+ adresse_electronique: null,
28
+ email: null,
29
+ telephone: null
30
+ )
31
+ ```
32
+
@@ -0,0 +1,15 @@
1
+ # FactPulse::TypeDocument
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+
8
+ ## Example
9
+
10
+ ```ruby
11
+ require 'factpulse'
12
+
13
+ instance = FactPulse::TypeDocument.new()
14
+ ```
15
+
@@ -76,6 +76,69 @@ module FactPulse
76
76
  return data, status_code, headers
77
77
  end
78
78
 
79
+ # Récupérer et extraire une facture entrante
80
+ # Télécharge un flux entrant depuis la PDP AFNOR et extrait les métadonnées de la facture vers un format JSON unifié. Supporte les formats Factur-X, CII et UBL.
81
+ # @param flow_id [String]
82
+ # @param [Hash] opts the optional parameters
83
+ # @return [FactureEntrante]
84
+ def get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get(flow_id, opts = {})
85
+ data, _status_code, _headers = get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get_with_http_info(flow_id, opts)
86
+ data
87
+ end
88
+
89
+ # Récupérer et extraire une facture entrante
90
+ # Télécharge un flux entrant depuis la PDP AFNOR et extrait les métadonnées de la facture vers un format JSON unifié. Supporte les formats Factur-X, CII et UBL.
91
+ # @param flow_id [String]
92
+ # @param [Hash] opts the optional parameters
93
+ # @return [Array<(FactureEntrante, Integer, Hash)>] FactureEntrante data, response status code and response headers
94
+ def get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get_with_http_info(flow_id, opts = {})
95
+ if @api_client.config.debugging
96
+ @api_client.config.logger.debug 'Calling API: AFNORPDPPAApi.get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get ...'
97
+ end
98
+ # verify the required parameter 'flow_id' is set
99
+ if @api_client.config.client_side_validation && flow_id.nil?
100
+ fail ArgumentError, "Missing the required parameter 'flow_id' when calling AFNORPDPPAApi.get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get"
101
+ end
102
+ # resource path
103
+ local_var_path = '/api/v1/afnor/flux-entrants/{flow_id}'.sub('{' + 'flow_id' + '}', CGI.escape(flow_id.to_s))
104
+
105
+ # query parameters
106
+ query_params = opts[:query_params] || {}
107
+
108
+ # header parameters
109
+ header_params = opts[:header_params] || {}
110
+ # HTTP header 'Accept' (if needed)
111
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
112
+
113
+ # form parameters
114
+ form_params = opts[:form_params] || {}
115
+
116
+ # http body (model)
117
+ post_body = opts[:debug_body]
118
+
119
+ # return_type
120
+ return_type = opts[:debug_return_type] || 'FactureEntrante'
121
+
122
+ # auth_names
123
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
124
+
125
+ new_options = opts.merge(
126
+ :operation => :"AFNORPDPPAApi.get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get",
127
+ :header_params => header_params,
128
+ :query_params => query_params,
129
+ :form_params => form_params,
130
+ :body => post_body,
131
+ :auth_names => auth_names,
132
+ :return_type => return_type
133
+ )
134
+
135
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
136
+ if @api_client.config.debugging
137
+ @api_client.config.logger.debug "API called: AFNORPDPPAApi#get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
138
+ end
139
+ return data, status_code, headers
140
+ end
141
+
79
142
  # Endpoint OAuth2 pour authentification AFNOR
80
143
  # Endpoint proxy OAuth2 pour obtenir un token d'accès AFNOR. Fait proxy vers le mock AFNOR (sandbox) ou la vraie PDP selon MOCK_AFNOR_BASE_URL. Cet endpoint est public (pas d'auth Django requise) car il est appelé par le SDK AFNOR.
81
144
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,492 @@
1
+ =begin
2
+ #API REST FactPulse
3
+
4
+ # API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Paramètre optionnel `client_uid` :** Pour sélectionner les credentials d'un client spécifique (PA/PDP, Chorus Pro, certificats de signature), ajoutez `client_uid` : ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` Le `client_uid` sera inclus dans le JWT et permettra à l'API d'utiliser automatiquement : - Les credentials AFNOR/PDP configurés pour ce client - Les credentials Chorus Pro configurés pour ce client - Les certificats de signature électronique configurés pour ce client **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : 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.18.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ # Facture reçue d'un fournisseur via PDP/PA. Ce modèle contient les métadonnées essentielles extraites des factures entrantes, quel que soit leur format source (CII, UBL, Factur-X). Les montants sont en Decimal en Python mais seront sérialisés en string dans le JSON pour préserver la précision monétaire.
18
+ class FactureEntrante < ApiModelBase
19
+ attr_accessor :flow_id
20
+
21
+ # Format source de la facture
22
+ attr_accessor :format_source
23
+
24
+ # Numéro de facture émis par le fournisseur (BT-1)
25
+ attr_accessor :ref_fournisseur
26
+
27
+ # Type de document (BT-3)
28
+ attr_accessor :type_document
29
+
30
+ # Émetteur de la facture (SellerTradeParty)
31
+ attr_accessor :fournisseur
32
+
33
+ # Nom du destinataire / votre entreprise (BT-44)
34
+ attr_accessor :site_facturation_nom
35
+
36
+ attr_accessor :site_facturation_siret
37
+
38
+ # Date de la facture (BT-2) - YYYY-MM-DD
39
+ attr_accessor :date_de_piece
40
+
41
+ attr_accessor :date_reglement
42
+
43
+ # Code devise ISO (BT-5)
44
+ attr_accessor :devise
45
+
46
+ # Montant HT total (BT-109)
47
+ attr_accessor :montant_ht
48
+
49
+ # Montant TVA total (BT-110)
50
+ attr_accessor :montant_tva
51
+
52
+ # Montant TTC total (BT-112)
53
+ attr_accessor :montant_ttc
54
+
55
+ attr_accessor :numero_bon_commande
56
+
57
+ attr_accessor :reference_contrat
58
+
59
+ attr_accessor :objet_facture
60
+
61
+ class EnumAttributeValidator
62
+ attr_reader :datatype
63
+ attr_reader :allowable_values
64
+
65
+ def initialize(datatype, allowable_values)
66
+ @allowable_values = allowable_values.map do |value|
67
+ case datatype.to_s
68
+ when /Integer/i
69
+ value.to_i
70
+ when /Float/i
71
+ value.to_f
72
+ else
73
+ value
74
+ end
75
+ end
76
+ end
77
+
78
+ def valid?(value)
79
+ !value || allowable_values.include?(value)
80
+ end
81
+ end
82
+
83
+ # Attribute mapping from ruby-style variable name to JSON key.
84
+ def self.attribute_map
85
+ {
86
+ :'flow_id' => :'flow_id',
87
+ :'format_source' => :'format_source',
88
+ :'ref_fournisseur' => :'ref_fournisseur',
89
+ :'type_document' => :'type_document',
90
+ :'fournisseur' => :'fournisseur',
91
+ :'site_facturation_nom' => :'site_facturation_nom',
92
+ :'site_facturation_siret' => :'site_facturation_siret',
93
+ :'date_de_piece' => :'date_de_piece',
94
+ :'date_reglement' => :'date_reglement',
95
+ :'devise' => :'devise',
96
+ :'montant_ht' => :'montant_ht',
97
+ :'montant_tva' => :'montant_tva',
98
+ :'montant_ttc' => :'montant_ttc',
99
+ :'numero_bon_commande' => :'numero_bon_commande',
100
+ :'reference_contrat' => :'reference_contrat',
101
+ :'objet_facture' => :'objet_facture'
102
+ }
103
+ end
104
+
105
+ # Returns attribute mapping this model knows about
106
+ def self.acceptable_attribute_map
107
+ attribute_map
108
+ end
109
+
110
+ # Returns all the JSON keys this model knows about
111
+ def self.acceptable_attributes
112
+ acceptable_attribute_map.values
113
+ end
114
+
115
+ # Attribute type mapping.
116
+ def self.openapi_types
117
+ {
118
+ :'flow_id' => :'String',
119
+ :'format_source' => :'FormatFacture',
120
+ :'ref_fournisseur' => :'String',
121
+ :'type_document' => :'TypeDocument',
122
+ :'fournisseur' => :'FournisseurEntrant',
123
+ :'site_facturation_nom' => :'String',
124
+ :'site_facturation_siret' => :'String',
125
+ :'date_de_piece' => :'String',
126
+ :'date_reglement' => :'String',
127
+ :'devise' => :'String',
128
+ :'montant_ht' => :'String',
129
+ :'montant_tva' => :'String',
130
+ :'montant_ttc' => :'String',
131
+ :'numero_bon_commande' => :'String',
132
+ :'reference_contrat' => :'String',
133
+ :'objet_facture' => :'String'
134
+ }
135
+ end
136
+
137
+ # List of attributes with nullable: true
138
+ def self.openapi_nullable
139
+ Set.new([
140
+ :'flow_id',
141
+ :'site_facturation_siret',
142
+ :'date_reglement',
143
+ :'numero_bon_commande',
144
+ :'reference_contrat',
145
+ :'objet_facture'
146
+ ])
147
+ end
148
+
149
+ # Initializes the object
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ def initialize(attributes = {})
152
+ if (!attributes.is_a?(Hash))
153
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::FactureEntrante` initialize method"
154
+ end
155
+
156
+ # check to see if the attribute exists and convert string to symbol for hash key
157
+ acceptable_attribute_map = self.class.acceptable_attribute_map
158
+ attributes = attributes.each_with_object({}) { |(k, v), h|
159
+ if (!acceptable_attribute_map.key?(k.to_sym))
160
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::FactureEntrante`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
161
+ end
162
+ h[k.to_sym] = v
163
+ }
164
+
165
+ if attributes.key?(:'flow_id')
166
+ self.flow_id = attributes[:'flow_id']
167
+ end
168
+
169
+ if attributes.key?(:'format_source')
170
+ self.format_source = attributes[:'format_source']
171
+ else
172
+ self.format_source = nil
173
+ end
174
+
175
+ if attributes.key?(:'ref_fournisseur')
176
+ self.ref_fournisseur = attributes[:'ref_fournisseur']
177
+ else
178
+ self.ref_fournisseur = nil
179
+ end
180
+
181
+ if attributes.key?(:'type_document')
182
+ self.type_document = attributes[:'type_document']
183
+ end
184
+
185
+ if attributes.key?(:'fournisseur')
186
+ self.fournisseur = attributes[:'fournisseur']
187
+ else
188
+ self.fournisseur = nil
189
+ end
190
+
191
+ if attributes.key?(:'site_facturation_nom')
192
+ self.site_facturation_nom = attributes[:'site_facturation_nom']
193
+ else
194
+ self.site_facturation_nom = nil
195
+ end
196
+
197
+ if attributes.key?(:'site_facturation_siret')
198
+ self.site_facturation_siret = attributes[:'site_facturation_siret']
199
+ end
200
+
201
+ if attributes.key?(:'date_de_piece')
202
+ self.date_de_piece = attributes[:'date_de_piece']
203
+ else
204
+ self.date_de_piece = nil
205
+ end
206
+
207
+ if attributes.key?(:'date_reglement')
208
+ self.date_reglement = attributes[:'date_reglement']
209
+ end
210
+
211
+ if attributes.key?(:'devise')
212
+ self.devise = attributes[:'devise']
213
+ else
214
+ self.devise = 'EUR'
215
+ end
216
+
217
+ if attributes.key?(:'montant_ht')
218
+ self.montant_ht = attributes[:'montant_ht']
219
+ else
220
+ self.montant_ht = nil
221
+ end
222
+
223
+ if attributes.key?(:'montant_tva')
224
+ self.montant_tva = attributes[:'montant_tva']
225
+ else
226
+ self.montant_tva = nil
227
+ end
228
+
229
+ if attributes.key?(:'montant_ttc')
230
+ self.montant_ttc = attributes[:'montant_ttc']
231
+ else
232
+ self.montant_ttc = nil
233
+ end
234
+
235
+ if attributes.key?(:'numero_bon_commande')
236
+ self.numero_bon_commande = attributes[:'numero_bon_commande']
237
+ end
238
+
239
+ if attributes.key?(:'reference_contrat')
240
+ self.reference_contrat = attributes[:'reference_contrat']
241
+ end
242
+
243
+ if attributes.key?(:'objet_facture')
244
+ self.objet_facture = attributes[:'objet_facture']
245
+ end
246
+ end
247
+
248
+ # Show invalid properties with the reasons. Usually used together with valid?
249
+ # @return Array for valid properties with the reasons
250
+ def list_invalid_properties
251
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
252
+ invalid_properties = Array.new
253
+ if @format_source.nil?
254
+ invalid_properties.push('invalid value for "format_source", format_source cannot be nil.')
255
+ end
256
+
257
+ if @ref_fournisseur.nil?
258
+ invalid_properties.push('invalid value for "ref_fournisseur", ref_fournisseur cannot be nil.')
259
+ end
260
+
261
+ if @fournisseur.nil?
262
+ invalid_properties.push('invalid value for "fournisseur", fournisseur cannot be nil.')
263
+ end
264
+
265
+ if @site_facturation_nom.nil?
266
+ invalid_properties.push('invalid value for "site_facturation_nom", site_facturation_nom cannot be nil.')
267
+ end
268
+
269
+ if @date_de_piece.nil?
270
+ invalid_properties.push('invalid value for "date_de_piece", date_de_piece cannot be nil.')
271
+ end
272
+
273
+ if @montant_ht.nil?
274
+ invalid_properties.push('invalid value for "montant_ht", montant_ht cannot be nil.')
275
+ end
276
+
277
+ pattern = Regexp.new(/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/)
278
+ if @montant_ht !~ pattern
279
+ invalid_properties.push("invalid value for \"montant_ht\", must conform to the pattern #{pattern}.")
280
+ end
281
+
282
+ if @montant_tva.nil?
283
+ invalid_properties.push('invalid value for "montant_tva", montant_tva cannot be nil.')
284
+ end
285
+
286
+ pattern = Regexp.new(/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/)
287
+ if @montant_tva !~ pattern
288
+ invalid_properties.push("invalid value for \"montant_tva\", must conform to the pattern #{pattern}.")
289
+ end
290
+
291
+ if @montant_ttc.nil?
292
+ invalid_properties.push('invalid value for "montant_ttc", montant_ttc cannot be nil.')
293
+ end
294
+
295
+ pattern = Regexp.new(/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/)
296
+ if @montant_ttc !~ pattern
297
+ invalid_properties.push("invalid value for \"montant_ttc\", must conform to the pattern #{pattern}.")
298
+ end
299
+
300
+ invalid_properties
301
+ end
302
+
303
+ # Check to see if the all the properties in the model are valid
304
+ # @return true if the model is valid
305
+ def valid?
306
+ warn '[DEPRECATED] the `valid?` method is obsolete'
307
+ return false if @format_source.nil?
308
+ return false if @ref_fournisseur.nil?
309
+ return false if @fournisseur.nil?
310
+ return false if @site_facturation_nom.nil?
311
+ return false if @date_de_piece.nil?
312
+ return false if @montant_ht.nil?
313
+ return false if @montant_ht !~ Regexp.new(/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/)
314
+ return false if @montant_tva.nil?
315
+ return false if @montant_tva !~ Regexp.new(/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/)
316
+ return false if @montant_ttc.nil?
317
+ return false if @montant_ttc !~ Regexp.new(/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/)
318
+ true
319
+ end
320
+
321
+ # Custom attribute writer method with validation
322
+ # @param [Object] format_source Value to be assigned
323
+ def format_source=(format_source)
324
+ if format_source.nil?
325
+ fail ArgumentError, 'format_source cannot be nil'
326
+ end
327
+
328
+ @format_source = format_source
329
+ end
330
+
331
+ # Custom attribute writer method with validation
332
+ # @param [Object] ref_fournisseur Value to be assigned
333
+ def ref_fournisseur=(ref_fournisseur)
334
+ if ref_fournisseur.nil?
335
+ fail ArgumentError, 'ref_fournisseur cannot be nil'
336
+ end
337
+
338
+ @ref_fournisseur = ref_fournisseur
339
+ end
340
+
341
+ # Custom attribute writer method with validation
342
+ # @param [Object] fournisseur Value to be assigned
343
+ def fournisseur=(fournisseur)
344
+ if fournisseur.nil?
345
+ fail ArgumentError, 'fournisseur cannot be nil'
346
+ end
347
+
348
+ @fournisseur = fournisseur
349
+ end
350
+
351
+ # Custom attribute writer method with validation
352
+ # @param [Object] site_facturation_nom Value to be assigned
353
+ def site_facturation_nom=(site_facturation_nom)
354
+ if site_facturation_nom.nil?
355
+ fail ArgumentError, 'site_facturation_nom cannot be nil'
356
+ end
357
+
358
+ @site_facturation_nom = site_facturation_nom
359
+ end
360
+
361
+ # Custom attribute writer method with validation
362
+ # @param [Object] date_de_piece Value to be assigned
363
+ def date_de_piece=(date_de_piece)
364
+ if date_de_piece.nil?
365
+ fail ArgumentError, 'date_de_piece cannot be nil'
366
+ end
367
+
368
+ @date_de_piece = date_de_piece
369
+ end
370
+
371
+ # Custom attribute writer method with validation
372
+ # @param [Object] montant_ht Value to be assigned
373
+ def montant_ht=(montant_ht)
374
+ if montant_ht.nil?
375
+ fail ArgumentError, 'montant_ht cannot be nil'
376
+ end
377
+
378
+ pattern = Regexp.new(/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/)
379
+ if montant_ht !~ pattern
380
+ fail ArgumentError, "invalid value for \"montant_ht\", must conform to the pattern #{pattern}."
381
+ end
382
+
383
+ @montant_ht = montant_ht
384
+ end
385
+
386
+ # Custom attribute writer method with validation
387
+ # @param [Object] montant_tva Value to be assigned
388
+ def montant_tva=(montant_tva)
389
+ if montant_tva.nil?
390
+ fail ArgumentError, 'montant_tva cannot be nil'
391
+ end
392
+
393
+ pattern = Regexp.new(/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/)
394
+ if montant_tva !~ pattern
395
+ fail ArgumentError, "invalid value for \"montant_tva\", must conform to the pattern #{pattern}."
396
+ end
397
+
398
+ @montant_tva = montant_tva
399
+ end
400
+
401
+ # Custom attribute writer method with validation
402
+ # @param [Object] montant_ttc Value to be assigned
403
+ def montant_ttc=(montant_ttc)
404
+ if montant_ttc.nil?
405
+ fail ArgumentError, 'montant_ttc cannot be nil'
406
+ end
407
+
408
+ pattern = Regexp.new(/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/)
409
+ if montant_ttc !~ pattern
410
+ fail ArgumentError, "invalid value for \"montant_ttc\", must conform to the pattern #{pattern}."
411
+ end
412
+
413
+ @montant_ttc = montant_ttc
414
+ end
415
+
416
+ # Checks equality by comparing each attribute.
417
+ # @param [Object] Object to be compared
418
+ def ==(o)
419
+ return true if self.equal?(o)
420
+ self.class == o.class &&
421
+ flow_id == o.flow_id &&
422
+ format_source == o.format_source &&
423
+ ref_fournisseur == o.ref_fournisseur &&
424
+ type_document == o.type_document &&
425
+ fournisseur == o.fournisseur &&
426
+ site_facturation_nom == o.site_facturation_nom &&
427
+ site_facturation_siret == o.site_facturation_siret &&
428
+ date_de_piece == o.date_de_piece &&
429
+ date_reglement == o.date_reglement &&
430
+ devise == o.devise &&
431
+ montant_ht == o.montant_ht &&
432
+ montant_tva == o.montant_tva &&
433
+ montant_ttc == o.montant_ttc &&
434
+ numero_bon_commande == o.numero_bon_commande &&
435
+ reference_contrat == o.reference_contrat &&
436
+ objet_facture == o.objet_facture
437
+ end
438
+
439
+ # @see the `==` method
440
+ # @param [Object] Object to be compared
441
+ def eql?(o)
442
+ self == o
443
+ end
444
+
445
+ # Calculates hash code according to all attributes.
446
+ # @return [Integer] Hash code
447
+ def hash
448
+ [flow_id, format_source, ref_fournisseur, type_document, fournisseur, site_facturation_nom, site_facturation_siret, date_de_piece, date_reglement, devise, montant_ht, montant_tva, montant_ttc, numero_bon_commande, reference_contrat, objet_facture].hash
449
+ end
450
+
451
+ # Builds the object from hash
452
+ # @param [Hash] attributes Model attributes in the form of hash
453
+ # @return [Object] Returns the model itself
454
+ def self.build_from_hash(attributes)
455
+ return nil unless attributes.is_a?(Hash)
456
+ attributes = attributes.transform_keys(&:to_sym)
457
+ transformed_hash = {}
458
+ openapi_types.each_pair do |key, type|
459
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
460
+ transformed_hash["#{key}"] = nil
461
+ elsif type =~ /\AArray<(.*)>/i
462
+ # check to ensure the input is an array given that the attribute
463
+ # is documented as an array but the input is not
464
+ if attributes[attribute_map[key]].is_a?(Array)
465
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
466
+ end
467
+ elsif !attributes[attribute_map[key]].nil?
468
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
469
+ end
470
+ end
471
+ new(transformed_hash)
472
+ end
473
+
474
+ # Returns the object in the form of hash
475
+ # @return [Hash] Returns the object in the form of hash
476
+ def to_hash
477
+ hash = {}
478
+ self.class.attribute_map.each_pair do |attr, param|
479
+ value = self.send(attr)
480
+ if value.nil?
481
+ is_nullable = self.class.openapi_nullable.include?(attr)
482
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
483
+ end
484
+
485
+ hash[param] = _to_hash(value)
486
+ end
487
+ hash
488
+ end
489
+
490
+ end
491
+
492
+ end
@@ -0,0 +1,41 @@
1
+ =begin
2
+ #API REST FactPulse
3
+
4
+ # API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Paramètre optionnel `client_uid` :** Pour sélectionner les credentials d'un client spécifique (PA/PDP, Chorus Pro, certificats de signature), ajoutez `client_uid` : ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` Le `client_uid` sera inclus dans le JWT et permettra à l'API d'utiliser automatiquement : - Les credentials AFNOR/PDP configurés pour ce client - Les credentials Chorus Pro configurés pour ce client - Les certificats de signature électronique configurés pour ce client **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : 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.18.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ class FormatFacture
18
+ CII = "CII".freeze
19
+ UBL = "UBL".freeze
20
+ FACTUR_X = "Factur-X".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [CII, UBL, FACTUR_X].freeze
24
+ end
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ new.build_from_hash(value)
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def build_from_hash(value)
37
+ return value if FormatFacture.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #FormatFacture"
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,236 @@
1
+ =begin
2
+ #API REST FactPulse
3
+
4
+ # API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Paramètre optionnel `client_uid` :** Pour sélectionner les credentials d'un client spécifique (PA/PDP, Chorus Pro, certificats de signature), ajoutez `client_uid` : ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` Le `client_uid` sera inclus dans le JWT et permettra à l'API d'utiliser automatiquement : - Les credentials AFNOR/PDP configurés pour ce client - Les credentials Chorus Pro configurés pour ce client - Les certificats de signature électronique configurés pour ce client **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : 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.18.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ # Fournisseur extrait d'une facture entrante. Contrairement au modèle Fournisseur de models.py, ce modèle n'a pas de champ id_fournisseur car cette information n'est pas disponible dans les XML Factur-X/CII/UBL.
18
+ class FournisseurEntrant < ApiModelBase
19
+ # Raison sociale du fournisseur (BT-27)
20
+ attr_accessor :nom
21
+
22
+ attr_accessor :siren
23
+
24
+ attr_accessor :siret
25
+
26
+ attr_accessor :numero_tva_intra
27
+
28
+ attr_accessor :adresse_postale
29
+
30
+ attr_accessor :adresse_electronique
31
+
32
+ attr_accessor :email
33
+
34
+ attr_accessor :telephone
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'nom' => :'nom',
40
+ :'siren' => :'siren',
41
+ :'siret' => :'siret',
42
+ :'numero_tva_intra' => :'numero_tva_intra',
43
+ :'adresse_postale' => :'adresse_postale',
44
+ :'adresse_electronique' => :'adresse_electronique',
45
+ :'email' => :'email',
46
+ :'telephone' => :'telephone'
47
+ }
48
+ end
49
+
50
+ # Returns attribute mapping this model knows about
51
+ def self.acceptable_attribute_map
52
+ attribute_map
53
+ end
54
+
55
+ # Returns all the JSON keys this model knows about
56
+ def self.acceptable_attributes
57
+ acceptable_attribute_map.values
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.openapi_types
62
+ {
63
+ :'nom' => :'String',
64
+ :'siren' => :'String',
65
+ :'siret' => :'String',
66
+ :'numero_tva_intra' => :'String',
67
+ :'adresse_postale' => :'AdressePostale',
68
+ :'adresse_electronique' => :'AdresseElectronique',
69
+ :'email' => :'String',
70
+ :'telephone' => :'String'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ :'siren',
78
+ :'siret',
79
+ :'numero_tva_intra',
80
+ :'adresse_postale',
81
+ :'adresse_electronique',
82
+ :'email',
83
+ :'telephone'
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::FournisseurEntrant` 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::FournisseurEntrant`. 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?(:'nom')
104
+ self.nom = attributes[:'nom']
105
+ else
106
+ self.nom = nil
107
+ end
108
+
109
+ if attributes.key?(:'siren')
110
+ self.siren = attributes[:'siren']
111
+ end
112
+
113
+ if attributes.key?(:'siret')
114
+ self.siret = attributes[:'siret']
115
+ end
116
+
117
+ if attributes.key?(:'numero_tva_intra')
118
+ self.numero_tva_intra = attributes[:'numero_tva_intra']
119
+ end
120
+
121
+ if attributes.key?(:'adresse_postale')
122
+ self.adresse_postale = attributes[:'adresse_postale']
123
+ end
124
+
125
+ if attributes.key?(:'adresse_electronique')
126
+ self.adresse_electronique = attributes[:'adresse_electronique']
127
+ end
128
+
129
+ if attributes.key?(:'email')
130
+ self.email = attributes[:'email']
131
+ end
132
+
133
+ if attributes.key?(:'telephone')
134
+ self.telephone = attributes[:'telephone']
135
+ end
136
+ end
137
+
138
+ # Show invalid properties with the reasons. Usually used together with valid?
139
+ # @return Array for valid properties with the reasons
140
+ def list_invalid_properties
141
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
142
+ invalid_properties = Array.new
143
+ if @nom.nil?
144
+ invalid_properties.push('invalid value for "nom", nom cannot be nil.')
145
+ end
146
+
147
+ invalid_properties
148
+ end
149
+
150
+ # Check to see if the all the properties in the model are valid
151
+ # @return true if the model is valid
152
+ def valid?
153
+ warn '[DEPRECATED] the `valid?` method is obsolete'
154
+ return false if @nom.nil?
155
+ true
156
+ end
157
+
158
+ # Custom attribute writer method with validation
159
+ # @param [Object] nom Value to be assigned
160
+ def nom=(nom)
161
+ if nom.nil?
162
+ fail ArgumentError, 'nom cannot be nil'
163
+ end
164
+
165
+ @nom = nom
166
+ end
167
+
168
+ # Checks equality by comparing each attribute.
169
+ # @param [Object] Object to be compared
170
+ def ==(o)
171
+ return true if self.equal?(o)
172
+ self.class == o.class &&
173
+ nom == o.nom &&
174
+ siren == o.siren &&
175
+ siret == o.siret &&
176
+ numero_tva_intra == o.numero_tva_intra &&
177
+ adresse_postale == o.adresse_postale &&
178
+ adresse_electronique == o.adresse_electronique &&
179
+ email == o.email &&
180
+ telephone == o.telephone
181
+ end
182
+
183
+ # @see the `==` method
184
+ # @param [Object] Object to be compared
185
+ def eql?(o)
186
+ self == o
187
+ end
188
+
189
+ # Calculates hash code according to all attributes.
190
+ # @return [Integer] Hash code
191
+ def hash
192
+ [nom, siren, siret, numero_tva_intra, adresse_postale, adresse_electronique, email, telephone].hash
193
+ end
194
+
195
+ # Builds the object from hash
196
+ # @param [Hash] attributes Model attributes in the form of hash
197
+ # @return [Object] Returns the model itself
198
+ def self.build_from_hash(attributes)
199
+ return nil unless attributes.is_a?(Hash)
200
+ attributes = attributes.transform_keys(&:to_sym)
201
+ transformed_hash = {}
202
+ openapi_types.each_pair do |key, type|
203
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
204
+ transformed_hash["#{key}"] = nil
205
+ elsif type =~ /\AArray<(.*)>/i
206
+ # check to ensure the input is an array given that the attribute
207
+ # is documented as an array but the input is not
208
+ if attributes[attribute_map[key]].is_a?(Array)
209
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
210
+ end
211
+ elsif !attributes[attribute_map[key]].nil?
212
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
213
+ end
214
+ end
215
+ new(transformed_hash)
216
+ end
217
+
218
+ # Returns the object in the form of hash
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_hash
221
+ hash = {}
222
+ self.class.attribute_map.each_pair do |attr, param|
223
+ value = self.send(attr)
224
+ if value.nil?
225
+ is_nullable = self.class.openapi_nullable.include?(attr)
226
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
227
+ end
228
+
229
+ hash[param] = _to_hash(value)
230
+ end
231
+ hash
232
+ end
233
+
234
+ end
235
+
236
+ end
@@ -0,0 +1,43 @@
1
+ =begin
2
+ #API REST FactPulse
3
+
4
+ # API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Paramètre optionnel `client_uid` :** Pour sélectionner les credentials d'un client spécifique (PA/PDP, Chorus Pro, certificats de signature), ajoutez `client_uid` : ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` Le `client_uid` sera inclus dans le JWT et permettra à l'API d'utiliser automatiquement : - Les credentials AFNOR/PDP configurés pour ce client - Les credentials Chorus Pro configurés pour ce client - Les certificats de signature électronique configurés pour ce client **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : 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.18.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ class TypeDocument
18
+ N380 = "380".freeze
19
+ N381 = "381".freeze
20
+ N384 = "384".freeze
21
+ N386 = "386".freeze
22
+ N389 = "389".freeze
23
+
24
+ def self.all_vars
25
+ @all_vars ||= [N380, N381, N384, N386, N389].freeze
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def self.build_from_hash(value)
32
+ new.build_from_hash(value)
33
+ end
34
+
35
+ # Builds the enum from string
36
+ # @param [String] The enum value in the form of the string
37
+ # @return [String] The enum value
38
+ def build_from_hash(value)
39
+ return value if TypeDocument.all_vars.include?(value)
40
+ raise "Invalid ENUM value #{value} for class #TypeDocument"
41
+ end
42
+ end
43
+ end
@@ -11,5 +11,5 @@ Generator version: 7.18.0-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module FactPulse
14
- VERSION = '2.0.30'
14
+ VERSION = '2.0.31'
15
15
  end
data/lib/factpulse.rb CHANGED
@@ -41,9 +41,12 @@ require 'factpulse/models/donnees_facture_simplifiees'
41
41
  require 'factpulse/models/error_level'
42
42
  require 'factpulse/models/error_source'
43
43
  require 'factpulse/models/facture_enrichie_info'
44
+ require 'factpulse/models/facture_entrante'
44
45
  require 'factpulse/models/facture_factur_x'
46
+ require 'factpulse/models/format_facture'
45
47
  require 'factpulse/models/format_sortie'
46
48
  require 'factpulse/models/fournisseur'
49
+ require 'factpulse/models/fournisseur_entrant'
47
50
  require 'factpulse/models/generate_certificate_request'
48
51
  require 'factpulse/models/generate_certificate_response'
49
52
  require 'factpulse/models/http_validation_error'
@@ -98,6 +101,7 @@ require 'factpulse/models/statut_facture'
98
101
  require 'factpulse/models/statut_tache'
99
102
  require 'factpulse/models/structure_info'
100
103
  require 'factpulse/models/tauxmanuel'
104
+ require 'factpulse/models/type_document'
101
105
  require 'factpulse/models/type_facture'
102
106
  require 'factpulse/models/type_tva'
103
107
  require 'factpulse/models/unite'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factpulse
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.30
4
+ version: 2.0.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
@@ -149,9 +149,12 @@ files:
149
149
  - docs/ErrorLevel.md
150
150
  - docs/ErrorSource.md
151
151
  - docs/FactureEnrichieInfo.md
152
+ - docs/FactureEntrante.md
152
153
  - docs/FactureFacturX.md
154
+ - docs/FormatFacture.md
153
155
  - docs/FormatSortie.md
154
156
  - docs/Fournisseur.md
157
+ - docs/FournisseurEntrant.md
155
158
  - docs/GenerateCertificateRequest.md
156
159
  - docs/GenerateCertificateResponse.md
157
160
  - docs/HTTPValidationError.md
@@ -208,6 +211,7 @@ files:
208
211
  - docs/StructureInfo.md
209
212
  - docs/Tauxmanuel.md
210
213
  - docs/TraitementFactureApi.md
214
+ - docs/TypeDocument.md
211
215
  - docs/TypeFacture.md
212
216
  - docs/TypeTVA.md
213
217
  - docs/Unite.md
@@ -255,9 +259,12 @@ files:
255
259
  - lib/factpulse/models/error_level.rb
256
260
  - lib/factpulse/models/error_source.rb
257
261
  - lib/factpulse/models/facture_enrichie_info.rb
262
+ - lib/factpulse/models/facture_entrante.rb
258
263
  - lib/factpulse/models/facture_factur_x.rb
264
+ - lib/factpulse/models/format_facture.rb
259
265
  - lib/factpulse/models/format_sortie.rb
260
266
  - lib/factpulse/models/fournisseur.rb
267
+ - lib/factpulse/models/fournisseur_entrant.rb
261
268
  - lib/factpulse/models/generate_certificate_request.rb
262
269
  - lib/factpulse/models/generate_certificate_response.rb
263
270
  - lib/factpulse/models/http_validation_error.rb
@@ -312,6 +319,7 @@ files:
312
319
  - lib/factpulse/models/statut_tache.rb
313
320
  - lib/factpulse/models/structure_info.rb
314
321
  - lib/factpulse/models/tauxmanuel.rb
322
+ - lib/factpulse/models/type_document.rb
315
323
  - lib/factpulse/models/type_facture.rb
316
324
  - lib/factpulse/models/type_tva.rb
317
325
  - lib/factpulse/models/unite.rb