factpulse 2.0.5 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -3
- data/Gemfile.lock +1 -1
- data/docs/Destinataire.md +4 -0
- data/docs/FactureFacturX.md +2 -0
- data/docs/Fournisseur.md +2 -0
- data/docs/LigneDePoste.md +6 -6
- data/docs/LigneDeTVA.md +6 -6
- data/docs/MontantTotal.md +12 -12
- data/docs/Note.md +20 -0
- data/docs/{Tauxmanuel.md → StatutCelery.md} +2 -2
- data/docs/StatutTache.md +1 -1
- data/docs/TraitementFactureApi.md +1 -1
- data/lib/factpulse/api/traitement_facture_api.rb +2 -2
- data/lib/factpulse/models/destinataire.rb +21 -1
- data/lib/factpulse/models/facture_factur_x.rb +12 -1
- data/lib/factpulse/models/fournisseur.rb +11 -1
- data/lib/factpulse/models/ligne_de_poste.rb +61 -4
- data/lib/factpulse/models/ligne_de_tva.rb +49 -3
- data/lib/factpulse/models/montant_ht_total.rb +0 -1
- data/lib/factpulse/models/montant_total.rb +94 -7
- data/lib/factpulse/models/montant_ttc_total.rb +0 -1
- data/lib/factpulse/models/montant_tva.rb +0 -1
- data/lib/factpulse/models/montant_tva1.rb +1 -1
- data/lib/factpulse/models/{ligne_de_poste_montant_remise_ht.rb → note.rb} +145 -74
- data/lib/factpulse/models/{montant_a_payer.rb → statut_celery.rb} +22 -83
- data/lib/factpulse/models/statut_tache.rb +25 -2
- data/lib/factpulse/version.rb +1 -1
- data/lib/factpulse.rb +2 -8
- metadata +5 -17
- data/docs/LigneDePosteMontantRemiseHt.md +0 -15
- data/docs/LigneDePosteTauxTvaManuel.md +0 -15
- data/docs/MontantAPayer.md +0 -15
- data/docs/MontantBaseHt.md +0 -15
- data/docs/MontantRemiseGlobaleTtc.md +0 -15
- data/docs/MontantTotalAcompte.md +0 -15
- data/docs/MontantTotalLigneHt.md +0 -15
- data/lib/factpulse/models/ligne_de_poste_taux_tva_manuel.rb +0 -104
- data/lib/factpulse/models/montant_base_ht.rb +0 -104
- data/lib/factpulse/models/montant_remise_globale_ttc.rb +0 -104
- data/lib/factpulse/models/montant_total_acompte.rb +0 -104
- data/lib/factpulse/models/montant_total_ligne_ht.rb +0 -104
- data/lib/factpulse/models/tauxmanuel.rb +0 -104
|
@@ -14,91 +14,30 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
# Builds the object
|
|
29
|
-
# @param [Mixed] Data to be matched against the list of anyOf items
|
|
30
|
-
# @return [Object] Returns the model or the data itself
|
|
31
|
-
def build(data)
|
|
32
|
-
# Go through the list of anyOf items and attempt to identify the appropriate one.
|
|
33
|
-
# Note:
|
|
34
|
-
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
35
|
-
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
36
|
-
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
37
|
-
# - TODO: logging when debugging is set.
|
|
38
|
-
openapi_any_of.each do |klass|
|
|
39
|
-
begin
|
|
40
|
-
next if klass == :AnyType # "nullable: true"
|
|
41
|
-
return find_and_cast_into_type(klass, data)
|
|
42
|
-
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
openapi_any_of.include?(:AnyType) ? data : nil
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
private
|
|
50
|
-
|
|
51
|
-
SchemaMismatchError = Class.new(StandardError)
|
|
52
|
-
|
|
53
|
-
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
54
|
-
def find_and_cast_into_type(klass, data)
|
|
55
|
-
return if data.nil?
|
|
17
|
+
class StatutCelery
|
|
18
|
+
PENDING = "PENDING".freeze
|
|
19
|
+
STARTED = "STARTED".freeze
|
|
20
|
+
SUCCESS = "SUCCESS".freeze
|
|
21
|
+
FAILURE = "FAILURE".freeze
|
|
22
|
+
RETRY = "RETRY".freeze
|
|
23
|
+
|
|
24
|
+
def self.all_vars
|
|
25
|
+
@all_vars ||= [PENDING, STARTED, SUCCESS, FAILURE, RETRY].freeze
|
|
26
|
+
end
|
|
56
27
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return data if data.instance_of?(Integer)
|
|
64
|
-
when 'Time'
|
|
65
|
-
return Time.parse(data)
|
|
66
|
-
when 'Date'
|
|
67
|
-
return Date.iso8601(data)
|
|
68
|
-
when 'String'
|
|
69
|
-
return data if data.instance_of?(String)
|
|
70
|
-
when 'Object' # "type: object"
|
|
71
|
-
return data if data.instance_of?(Hash)
|
|
72
|
-
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
73
|
-
if data.instance_of?(Array)
|
|
74
|
-
sub_type = Regexp.last_match[:sub_type]
|
|
75
|
-
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
76
|
-
end
|
|
77
|
-
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
78
|
-
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
79
|
-
sub_type = Regexp.last_match[:sub_type]
|
|
80
|
-
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
81
|
-
end
|
|
82
|
-
else # model
|
|
83
|
-
const = FactPulse.const_get(klass)
|
|
84
|
-
if const
|
|
85
|
-
if const.respond_to?(:openapi_any_of) # nested anyOf model
|
|
86
|
-
model = const.build(data)
|
|
87
|
-
return model if model
|
|
88
|
-
else
|
|
89
|
-
# raise if data contains keys that are not known to the model
|
|
90
|
-
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
91
|
-
model = const.build_from_hash(data)
|
|
92
|
-
return model if model
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
end
|
|
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
|
|
96
34
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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 StatutCelery.all_vars.include?(value)
|
|
40
|
+
raise "Invalid ENUM value #{value} for class #StatutCelery"
|
|
101
41
|
end
|
|
102
42
|
end
|
|
103
|
-
|
|
104
43
|
end
|
|
@@ -14,14 +14,37 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
|
-
# Description complète du statut d'une tâche asynchrone.
|
|
17
|
+
# Description complète du statut d'une tâche asynchrone. Le champ `statut` indique l'état Celery de la tâche. Quand `statut=\"SUCCESS\"`, consultez `resultat.statut` pour le résultat métier (\"SUCCES\" ou \"ERREUR\").
|
|
18
18
|
class StatutTache < ApiModelBase
|
|
19
19
|
attr_accessor :id_tache
|
|
20
20
|
|
|
21
|
+
# Statut Celery de la tâche (PENDING, STARTED, SUCCESS, FAILURE, RETRY)
|
|
21
22
|
attr_accessor :statut
|
|
22
23
|
|
|
23
24
|
attr_accessor :resultat
|
|
24
25
|
|
|
26
|
+
class EnumAttributeValidator
|
|
27
|
+
attr_reader :datatype
|
|
28
|
+
attr_reader :allowable_values
|
|
29
|
+
|
|
30
|
+
def initialize(datatype, allowable_values)
|
|
31
|
+
@allowable_values = allowable_values.map do |value|
|
|
32
|
+
case datatype.to_s
|
|
33
|
+
when /Integer/i
|
|
34
|
+
value.to_i
|
|
35
|
+
when /Float/i
|
|
36
|
+
value.to_f
|
|
37
|
+
else
|
|
38
|
+
value
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def valid?(value)
|
|
44
|
+
!value || allowable_values.include?(value)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
25
48
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
49
|
def self.attribute_map
|
|
27
50
|
{
|
|
@@ -45,7 +68,7 @@ module FactPulse
|
|
|
45
68
|
def self.openapi_types
|
|
46
69
|
{
|
|
47
70
|
:'id_tache' => :'String',
|
|
48
|
-
:'statut' => :'
|
|
71
|
+
:'statut' => :'StatutCelery',
|
|
49
72
|
:'resultat' => :'Hash<String, Object>'
|
|
50
73
|
}
|
|
51
74
|
end
|
data/lib/factpulse/version.rb
CHANGED
data/lib/factpulse.rb
CHANGED
|
@@ -58,24 +58,18 @@ require 'factpulse/models/generate_certificate_response'
|
|
|
58
58
|
require 'factpulse/models/http_validation_error'
|
|
59
59
|
require 'factpulse/models/information_signature_api'
|
|
60
60
|
require 'factpulse/models/ligne_de_poste'
|
|
61
|
-
require 'factpulse/models/ligne_de_poste_montant_remise_ht'
|
|
62
|
-
require 'factpulse/models/ligne_de_poste_taux_tva_manuel'
|
|
63
61
|
require 'factpulse/models/ligne_de_tva'
|
|
64
62
|
require 'factpulse/models/mode_depot'
|
|
65
63
|
require 'factpulse/models/mode_paiement'
|
|
66
|
-
require 'factpulse/models/montant_a_payer'
|
|
67
|
-
require 'factpulse/models/montant_base_ht'
|
|
68
64
|
require 'factpulse/models/montant_ht_total'
|
|
69
65
|
require 'factpulse/models/montant_ht_total1'
|
|
70
|
-
require 'factpulse/models/montant_remise_globale_ttc'
|
|
71
66
|
require 'factpulse/models/montant_total'
|
|
72
|
-
require 'factpulse/models/montant_total_acompte'
|
|
73
|
-
require 'factpulse/models/montant_total_ligne_ht'
|
|
74
67
|
require 'factpulse/models/montant_ttc_total'
|
|
75
68
|
require 'factpulse/models/montant_ttc_total1'
|
|
76
69
|
require 'factpulse/models/montant_tva'
|
|
77
70
|
require 'factpulse/models/montant_tva1'
|
|
78
71
|
require 'factpulse/models/montant_unitaire_ht'
|
|
72
|
+
require 'factpulse/models/note'
|
|
79
73
|
require 'factpulse/models/obtenir_id_chorus_pro_request'
|
|
80
74
|
require 'factpulse/models/obtenir_id_chorus_pro_response'
|
|
81
75
|
require 'factpulse/models/options_processing'
|
|
@@ -103,10 +97,10 @@ require 'factpulse/models/soumettre_facture_complete_request'
|
|
|
103
97
|
require 'factpulse/models/soumettre_facture_complete_response'
|
|
104
98
|
require 'factpulse/models/soumettre_facture_request'
|
|
105
99
|
require 'factpulse/models/soumettre_facture_response'
|
|
100
|
+
require 'factpulse/models/statut_celery'
|
|
106
101
|
require 'factpulse/models/statut_facture'
|
|
107
102
|
require 'factpulse/models/statut_tache'
|
|
108
103
|
require 'factpulse/models/structure_info'
|
|
109
|
-
require 'factpulse/models/tauxmanuel'
|
|
110
104
|
require 'factpulse/models/type_facture'
|
|
111
105
|
require 'factpulse/models/type_tva'
|
|
112
106
|
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.
|
|
4
|
+
version: 2.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenAPI-Generator
|
|
@@ -166,24 +166,18 @@ files:
|
|
|
166
166
|
- docs/HTTPValidationError.md
|
|
167
167
|
- docs/InformationSignatureAPI.md
|
|
168
168
|
- docs/LigneDePoste.md
|
|
169
|
-
- docs/LigneDePosteMontantRemiseHt.md
|
|
170
|
-
- docs/LigneDePosteTauxTvaManuel.md
|
|
171
169
|
- docs/LigneDeTVA.md
|
|
172
170
|
- docs/ModeDepot.md
|
|
173
171
|
- docs/ModePaiement.md
|
|
174
|
-
- docs/MontantAPayer.md
|
|
175
|
-
- docs/MontantBaseHt.md
|
|
176
172
|
- docs/MontantHtTotal.md
|
|
177
173
|
- docs/MontantHtTotal1.md
|
|
178
|
-
- docs/MontantRemiseGlobaleTtc.md
|
|
179
174
|
- docs/MontantTotal.md
|
|
180
|
-
- docs/MontantTotalAcompte.md
|
|
181
|
-
- docs/MontantTotalLigneHt.md
|
|
182
175
|
- docs/MontantTtcTotal.md
|
|
183
176
|
- docs/MontantTtcTotal1.md
|
|
184
177
|
- docs/MontantTva.md
|
|
185
178
|
- docs/MontantTva1.md
|
|
186
179
|
- docs/MontantUnitaireHt.md
|
|
180
|
+
- docs/Note.md
|
|
187
181
|
- docs/ObtenirIdChorusProRequest.md
|
|
188
182
|
- docs/ObtenirIdChorusProResponse.md
|
|
189
183
|
- docs/OptionsProcessing.md
|
|
@@ -212,10 +206,10 @@ files:
|
|
|
212
206
|
- docs/SoumettreFactureCompleteResponse.md
|
|
213
207
|
- docs/SoumettreFactureRequest.md
|
|
214
208
|
- docs/SoumettreFactureResponse.md
|
|
209
|
+
- docs/StatutCelery.md
|
|
215
210
|
- docs/StatutFacture.md
|
|
216
211
|
- docs/StatutTache.md
|
|
217
212
|
- docs/StructureInfo.md
|
|
218
|
-
- docs/Tauxmanuel.md
|
|
219
213
|
- docs/TraitementFactureApi.md
|
|
220
214
|
- docs/TypeFacture.md
|
|
221
215
|
- docs/TypeTVA.md
|
|
@@ -278,24 +272,18 @@ files:
|
|
|
278
272
|
- lib/factpulse/models/http_validation_error.rb
|
|
279
273
|
- lib/factpulse/models/information_signature_api.rb
|
|
280
274
|
- lib/factpulse/models/ligne_de_poste.rb
|
|
281
|
-
- lib/factpulse/models/ligne_de_poste_montant_remise_ht.rb
|
|
282
|
-
- lib/factpulse/models/ligne_de_poste_taux_tva_manuel.rb
|
|
283
275
|
- lib/factpulse/models/ligne_de_tva.rb
|
|
284
276
|
- lib/factpulse/models/mode_depot.rb
|
|
285
277
|
- lib/factpulse/models/mode_paiement.rb
|
|
286
|
-
- lib/factpulse/models/montant_a_payer.rb
|
|
287
|
-
- lib/factpulse/models/montant_base_ht.rb
|
|
288
278
|
- lib/factpulse/models/montant_ht_total.rb
|
|
289
279
|
- lib/factpulse/models/montant_ht_total1.rb
|
|
290
|
-
- lib/factpulse/models/montant_remise_globale_ttc.rb
|
|
291
280
|
- lib/factpulse/models/montant_total.rb
|
|
292
|
-
- lib/factpulse/models/montant_total_acompte.rb
|
|
293
|
-
- lib/factpulse/models/montant_total_ligne_ht.rb
|
|
294
281
|
- lib/factpulse/models/montant_ttc_total.rb
|
|
295
282
|
- lib/factpulse/models/montant_ttc_total1.rb
|
|
296
283
|
- lib/factpulse/models/montant_tva.rb
|
|
297
284
|
- lib/factpulse/models/montant_tva1.rb
|
|
298
285
|
- lib/factpulse/models/montant_unitaire_ht.rb
|
|
286
|
+
- lib/factpulse/models/note.rb
|
|
299
287
|
- lib/factpulse/models/obtenir_id_chorus_pro_request.rb
|
|
300
288
|
- lib/factpulse/models/obtenir_id_chorus_pro_response.rb
|
|
301
289
|
- lib/factpulse/models/options_processing.rb
|
|
@@ -323,10 +311,10 @@ files:
|
|
|
323
311
|
- lib/factpulse/models/soumettre_facture_complete_response.rb
|
|
324
312
|
- lib/factpulse/models/soumettre_facture_request.rb
|
|
325
313
|
- lib/factpulse/models/soumettre_facture_response.rb
|
|
314
|
+
- lib/factpulse/models/statut_celery.rb
|
|
326
315
|
- lib/factpulse/models/statut_facture.rb
|
|
327
316
|
- lib/factpulse/models/statut_tache.rb
|
|
328
317
|
- lib/factpulse/models/structure_info.rb
|
|
329
|
-
- lib/factpulse/models/tauxmanuel.rb
|
|
330
318
|
- lib/factpulse/models/type_facture.rb
|
|
331
319
|
- lib/factpulse/models/type_tva.rb
|
|
332
320
|
- lib/factpulse/models/unite.rb
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# FactPulse::LigneDePosteMontantRemiseHt
|
|
2
|
-
|
|
3
|
-
## Properties
|
|
4
|
-
|
|
5
|
-
| Name | Type | Description | Notes |
|
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
|
|
8
|
-
## Example
|
|
9
|
-
|
|
10
|
-
```ruby
|
|
11
|
-
require 'factpulse'
|
|
12
|
-
|
|
13
|
-
instance = FactPulse::LigneDePosteMontantRemiseHt.new()
|
|
14
|
-
```
|
|
15
|
-
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# FactPulse::LigneDePosteTauxTvaManuel
|
|
2
|
-
|
|
3
|
-
## Properties
|
|
4
|
-
|
|
5
|
-
| Name | Type | Description | Notes |
|
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
|
|
8
|
-
## Example
|
|
9
|
-
|
|
10
|
-
```ruby
|
|
11
|
-
require 'factpulse'
|
|
12
|
-
|
|
13
|
-
instance = FactPulse::LigneDePosteTauxTvaManuel.new()
|
|
14
|
-
```
|
|
15
|
-
|
data/docs/MontantAPayer.md
DELETED
data/docs/MontantBaseHt.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# FactPulse::MontantRemiseGlobaleTtc
|
|
2
|
-
|
|
3
|
-
## Properties
|
|
4
|
-
|
|
5
|
-
| Name | Type | Description | Notes |
|
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
|
|
8
|
-
## Example
|
|
9
|
-
|
|
10
|
-
```ruby
|
|
11
|
-
require 'factpulse'
|
|
12
|
-
|
|
13
|
-
instance = FactPulse::MontantRemiseGlobaleTtc.new()
|
|
14
|
-
```
|
|
15
|
-
|
data/docs/MontantTotalAcompte.md
DELETED
data/docs/MontantTotalLigneHt.md
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
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
|
-
# Taux de TVA avec valeur manuelle.
|
|
18
|
-
module LigneDePosteTauxTvaManuel
|
|
19
|
-
class << self
|
|
20
|
-
# List of class defined in anyOf (OpenAPI v3)
|
|
21
|
-
def openapi_any_of
|
|
22
|
-
[
|
|
23
|
-
:'Float',
|
|
24
|
-
:'String'
|
|
25
|
-
]
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# Builds the object
|
|
29
|
-
# @param [Mixed] Data to be matched against the list of anyOf items
|
|
30
|
-
# @return [Object] Returns the model or the data itself
|
|
31
|
-
def build(data)
|
|
32
|
-
# Go through the list of anyOf items and attempt to identify the appropriate one.
|
|
33
|
-
# Note:
|
|
34
|
-
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
35
|
-
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
36
|
-
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
37
|
-
# - TODO: logging when debugging is set.
|
|
38
|
-
openapi_any_of.each do |klass|
|
|
39
|
-
begin
|
|
40
|
-
next if klass == :AnyType # "nullable: true"
|
|
41
|
-
return find_and_cast_into_type(klass, data)
|
|
42
|
-
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
openapi_any_of.include?(:AnyType) ? data : nil
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
private
|
|
50
|
-
|
|
51
|
-
SchemaMismatchError = Class.new(StandardError)
|
|
52
|
-
|
|
53
|
-
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
54
|
-
def find_and_cast_into_type(klass, data)
|
|
55
|
-
return if data.nil?
|
|
56
|
-
|
|
57
|
-
case klass.to_s
|
|
58
|
-
when 'Boolean'
|
|
59
|
-
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
60
|
-
when 'Float'
|
|
61
|
-
return data if data.instance_of?(Float)
|
|
62
|
-
when 'Integer'
|
|
63
|
-
return data if data.instance_of?(Integer)
|
|
64
|
-
when 'Time'
|
|
65
|
-
return Time.parse(data)
|
|
66
|
-
when 'Date'
|
|
67
|
-
return Date.iso8601(data)
|
|
68
|
-
when 'String'
|
|
69
|
-
return data if data.instance_of?(String)
|
|
70
|
-
when 'Object' # "type: object"
|
|
71
|
-
return data if data.instance_of?(Hash)
|
|
72
|
-
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
73
|
-
if data.instance_of?(Array)
|
|
74
|
-
sub_type = Regexp.last_match[:sub_type]
|
|
75
|
-
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
76
|
-
end
|
|
77
|
-
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
78
|
-
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
79
|
-
sub_type = Regexp.last_match[:sub_type]
|
|
80
|
-
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
81
|
-
end
|
|
82
|
-
else # model
|
|
83
|
-
const = FactPulse.const_get(klass)
|
|
84
|
-
if const
|
|
85
|
-
if const.respond_to?(:openapi_any_of) # nested anyOf model
|
|
86
|
-
model = const.build(data)
|
|
87
|
-
return model if model
|
|
88
|
-
else
|
|
89
|
-
# raise if data contains keys that are not known to the model
|
|
90
|
-
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
91
|
-
model = const.build_from_hash(data)
|
|
92
|
-
return model if model
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
raise # if no match by now, raise
|
|
98
|
-
rescue
|
|
99
|
-
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
100
|
-
end
|
|
101
|
-
end
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
end
|
|
@@ -1,104 +0,0 @@
|
|
|
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
|
-
# Montant de la base HT pour cette ligne de TVA.
|
|
18
|
-
module MontantBaseHt
|
|
19
|
-
class << self
|
|
20
|
-
# List of class defined in anyOf (OpenAPI v3)
|
|
21
|
-
def openapi_any_of
|
|
22
|
-
[
|
|
23
|
-
:'Float',
|
|
24
|
-
:'String'
|
|
25
|
-
]
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# Builds the object
|
|
29
|
-
# @param [Mixed] Data to be matched against the list of anyOf items
|
|
30
|
-
# @return [Object] Returns the model or the data itself
|
|
31
|
-
def build(data)
|
|
32
|
-
# Go through the list of anyOf items and attempt to identify the appropriate one.
|
|
33
|
-
# Note:
|
|
34
|
-
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
35
|
-
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
36
|
-
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
37
|
-
# - TODO: logging when debugging is set.
|
|
38
|
-
openapi_any_of.each do |klass|
|
|
39
|
-
begin
|
|
40
|
-
next if klass == :AnyType # "nullable: true"
|
|
41
|
-
return find_and_cast_into_type(klass, data)
|
|
42
|
-
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
openapi_any_of.include?(:AnyType) ? data : nil
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
private
|
|
50
|
-
|
|
51
|
-
SchemaMismatchError = Class.new(StandardError)
|
|
52
|
-
|
|
53
|
-
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
54
|
-
def find_and_cast_into_type(klass, data)
|
|
55
|
-
return if data.nil?
|
|
56
|
-
|
|
57
|
-
case klass.to_s
|
|
58
|
-
when 'Boolean'
|
|
59
|
-
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
60
|
-
when 'Float'
|
|
61
|
-
return data if data.instance_of?(Float)
|
|
62
|
-
when 'Integer'
|
|
63
|
-
return data if data.instance_of?(Integer)
|
|
64
|
-
when 'Time'
|
|
65
|
-
return Time.parse(data)
|
|
66
|
-
when 'Date'
|
|
67
|
-
return Date.iso8601(data)
|
|
68
|
-
when 'String'
|
|
69
|
-
return data if data.instance_of?(String)
|
|
70
|
-
when 'Object' # "type: object"
|
|
71
|
-
return data if data.instance_of?(Hash)
|
|
72
|
-
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
73
|
-
if data.instance_of?(Array)
|
|
74
|
-
sub_type = Regexp.last_match[:sub_type]
|
|
75
|
-
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
76
|
-
end
|
|
77
|
-
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
78
|
-
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
79
|
-
sub_type = Regexp.last_match[:sub_type]
|
|
80
|
-
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
81
|
-
end
|
|
82
|
-
else # model
|
|
83
|
-
const = FactPulse.const_get(klass)
|
|
84
|
-
if const
|
|
85
|
-
if const.respond_to?(:openapi_any_of) # nested anyOf model
|
|
86
|
-
model = const.build(data)
|
|
87
|
-
return model if model
|
|
88
|
-
else
|
|
89
|
-
# raise if data contains keys that are not known to the model
|
|
90
|
-
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
91
|
-
model = const.build_from_hash(data)
|
|
92
|
-
return model if model
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
raise # if no match by now, raise
|
|
98
|
-
rescue
|
|
99
|
-
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
100
|
-
end
|
|
101
|
-
end
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
end
|