factpulse 2.0.33 → 2.0.35
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 +2 -2
- data/docs/Note.md +4 -4
- data/lib/factpulse/helpers/client.rb +17 -3
- data/lib/factpulse/models/note.rb +23 -23
- data/lib/factpulse/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 06a73a52e699e6c3d620f218c681ed6d23b67ab5294a7ea1b80178073b21429f
|
|
4
|
+
data.tar.gz: dddd83a74e6d2432ce32254a0aa2f379797bac4e063b7e8cf00a25ea57ec358e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a87ce7d106b99dc59c3005ea49033138c56488aa904f0b2ca9105b177471ad35e8e0fc64f3fa96e9e4943be5d656592cdae3d3fa368e2e134c252aa07b94fd15
|
|
7
|
+
data.tar.gz: 1c969bbd50d5ae0df86858396dd5089545633985aecd9fdbb9078f9a3dd432908ff485f270f2640fd6bbe437085759bcc85aae5a9503615427198cee241ebf5f
|
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.
|
|
10
|
+
## [2.0.35] - 2025-12-04
|
|
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.
|
|
28
|
-
[2.0.
|
|
27
|
+
[Unreleased]: https://github.com/factpulse/sdk-ruby/compare/v2.0.35...HEAD
|
|
28
|
+
[2.0.35]: https://github.com/factpulse/sdk-ruby/releases/tag/v2.0.35
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
factpulse (2.0.
|
|
4
|
+
factpulse (2.0.35)
|
|
5
5
|
typhoeus (~> 1.0, >= 1.0.1)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -55,7 +55,7 @@ GEM
|
|
|
55
55
|
ruby-progressbar (~> 1.7)
|
|
56
56
|
unicode-display_width (>= 1.4.0, < 1.6)
|
|
57
57
|
ruby-progressbar (1.13.0)
|
|
58
|
-
stringio (3.1.
|
|
58
|
+
stringio (3.1.9)
|
|
59
59
|
typhoeus (1.5.0)
|
|
60
60
|
ethon (>= 0.9.0, < 0.16.0)
|
|
61
61
|
unicode-display_width (1.5.0)
|
data/docs/Note.md
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **
|
|
8
|
-
| **
|
|
7
|
+
| **code_sujet** | **String** | | [optional] |
|
|
8
|
+
| **contenu** | **String** | | |
|
|
9
9
|
|
|
10
10
|
## Example
|
|
11
11
|
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
require 'factpulse'
|
|
14
14
|
|
|
15
15
|
instance = FactPulse::Note.new(
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
code_sujet: null,
|
|
17
|
+
contenu: null
|
|
18
18
|
)
|
|
19
19
|
```
|
|
20
20
|
|
|
@@ -364,6 +364,9 @@ module FactPulse
|
|
|
364
364
|
# Télécharge un flux entrant depuis la PDP AFNOR et extrait les métadonnées
|
|
365
365
|
# de la facture vers un format JSON unifié. Supporte Factur-X, CII et UBL.
|
|
366
366
|
#
|
|
367
|
+
# Note: Cet endpoint utilise l'authentification JWT FactPulse (pas OAuth AFNOR).
|
|
368
|
+
# Le serveur FactPulse se charge d'appeler la PDP avec les credentials stockés.
|
|
369
|
+
#
|
|
367
370
|
# @param flow_id [String] Identifiant du flux (UUID)
|
|
368
371
|
# @param include_document [Boolean] Si true, inclut le document en base64
|
|
369
372
|
# @return [Hash] Métadonnées de la facture (fournisseur, montants, dates, etc.)
|
|
@@ -373,9 +376,20 @@ module FactPulse
|
|
|
373
376
|
# puts "Fournisseur: #{facture['fournisseur']['nom']}"
|
|
374
377
|
# puts "Montant TTC: #{facture['montant_ttc']} #{facture['devise']}"
|
|
375
378
|
def obtenir_facture_entrante_afnor(flow_id, include_document: false)
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
+
ensure_authenticated
|
|
380
|
+
uri = URI("#{@api_url}/api/v1/afnor/flux-entrants/#{flow_id}")
|
|
381
|
+
uri.query = "include_document=true" if include_document
|
|
382
|
+
|
|
383
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
384
|
+
http.use_ssl = uri.scheme == 'https'
|
|
385
|
+
http.read_timeout = 60
|
|
386
|
+
|
|
387
|
+
request = Net::HTTP::Get.new(uri)
|
|
388
|
+
request['Authorization'] = "Bearer #{@access_token}"
|
|
389
|
+
|
|
390
|
+
response = http.request(request)
|
|
391
|
+
raise FactPulseValidationError.new("Erreur flux entrant: #{response.code}") unless response.is_a?(Net::HTTPSuccess)
|
|
392
|
+
JSON.parse(response.body) rescue {}
|
|
379
393
|
end
|
|
380
394
|
|
|
381
395
|
# Vérifie la disponibilité du Flow Service AFNOR.
|
|
@@ -16,15 +16,15 @@ require 'time'
|
|
|
16
16
|
module FactPulse
|
|
17
17
|
# Note de facture (IncludedNote en Factur-X). Les notes obligatoires pour BR-FR-05 sont : - PMT : Indemnité forfaitaire pour frais de recouvrement - PMD : Pénalités de retard - AAB : Escompte pour paiement anticipé
|
|
18
18
|
class Note < ApiModelBase
|
|
19
|
-
attr_accessor :
|
|
19
|
+
attr_accessor :code_sujet
|
|
20
20
|
|
|
21
|
-
attr_accessor :
|
|
21
|
+
attr_accessor :contenu
|
|
22
22
|
|
|
23
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
24
|
def self.attribute_map
|
|
25
25
|
{
|
|
26
|
-
:'
|
|
27
|
-
:'
|
|
26
|
+
:'code_sujet' => :'codeSujet',
|
|
27
|
+
:'contenu' => :'contenu'
|
|
28
28
|
}
|
|
29
29
|
end
|
|
30
30
|
|
|
@@ -41,15 +41,15 @@ module FactPulse
|
|
|
41
41
|
# Attribute type mapping.
|
|
42
42
|
def self.openapi_types
|
|
43
43
|
{
|
|
44
|
-
:'
|
|
45
|
-
:'
|
|
44
|
+
:'code_sujet' => :'String',
|
|
45
|
+
:'contenu' => :'String'
|
|
46
46
|
}
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
# List of attributes with nullable: true
|
|
50
50
|
def self.openapi_nullable
|
|
51
51
|
Set.new([
|
|
52
|
-
:'
|
|
52
|
+
:'code_sujet',
|
|
53
53
|
])
|
|
54
54
|
end
|
|
55
55
|
|
|
@@ -69,14 +69,14 @@ module FactPulse
|
|
|
69
69
|
h[k.to_sym] = v
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
if attributes.key?(:'
|
|
73
|
-
self.
|
|
72
|
+
if attributes.key?(:'code_sujet')
|
|
73
|
+
self.code_sujet = attributes[:'code_sujet']
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
-
if attributes.key?(:'
|
|
77
|
-
self.
|
|
76
|
+
if attributes.key?(:'contenu')
|
|
77
|
+
self.contenu = attributes[:'contenu']
|
|
78
78
|
else
|
|
79
|
-
self.
|
|
79
|
+
self.contenu = nil
|
|
80
80
|
end
|
|
81
81
|
end
|
|
82
82
|
|
|
@@ -85,8 +85,8 @@ module FactPulse
|
|
|
85
85
|
def list_invalid_properties
|
|
86
86
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
87
|
invalid_properties = Array.new
|
|
88
|
-
if @
|
|
89
|
-
invalid_properties.push('invalid value for "
|
|
88
|
+
if @contenu.nil?
|
|
89
|
+
invalid_properties.push('invalid value for "contenu", contenu cannot be nil.')
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
invalid_properties
|
|
@@ -96,18 +96,18 @@ module FactPulse
|
|
|
96
96
|
# @return true if the model is valid
|
|
97
97
|
def valid?
|
|
98
98
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
99
|
-
return false if @
|
|
99
|
+
return false if @contenu.nil?
|
|
100
100
|
true
|
|
101
101
|
end
|
|
102
102
|
|
|
103
103
|
# Custom attribute writer method with validation
|
|
104
|
-
# @param [Object]
|
|
105
|
-
def
|
|
106
|
-
if
|
|
107
|
-
fail ArgumentError, '
|
|
104
|
+
# @param [Object] contenu Value to be assigned
|
|
105
|
+
def contenu=(contenu)
|
|
106
|
+
if contenu.nil?
|
|
107
|
+
fail ArgumentError, 'contenu cannot be nil'
|
|
108
108
|
end
|
|
109
109
|
|
|
110
|
-
@
|
|
110
|
+
@contenu = contenu
|
|
111
111
|
end
|
|
112
112
|
|
|
113
113
|
# Checks equality by comparing each attribute.
|
|
@@ -115,8 +115,8 @@ module FactPulse
|
|
|
115
115
|
def ==(o)
|
|
116
116
|
return true if self.equal?(o)
|
|
117
117
|
self.class == o.class &&
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
code_sujet == o.code_sujet &&
|
|
119
|
+
contenu == o.contenu
|
|
120
120
|
end
|
|
121
121
|
|
|
122
122
|
# @see the `==` method
|
|
@@ -128,7 +128,7 @@ module FactPulse
|
|
|
128
128
|
# Calculates hash code according to all attributes.
|
|
129
129
|
# @return [Integer] Hash code
|
|
130
130
|
def hash
|
|
131
|
-
[
|
|
131
|
+
[code_sujet, contenu].hash
|
|
132
132
|
end
|
|
133
133
|
|
|
134
134
|
# Builds the object from hash
|
data/lib/factpulse/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: factpulse
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.35
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenAPI-Generator
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-12-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: typhoeus
|