factpulse 2.0.37 → 2.0.39

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: 166d4cbd11f2aa858bf11390ff4f5a0d7086ca7a5863299d1852f1494e138db2
4
- data.tar.gz: 3e934fb8fe8d24554e071855d3931229fd92bba5b9130da3d2b3885ebe138f36
3
+ metadata.gz: 81f2bf81e331fa4ea5a6d971c94d0db47db63edead3adaad5df05b351627dfb6
4
+ data.tar.gz: e19b12b42adc2ccf2351e59074e9eba039ec782e0e2c56e8ad395a9655c1b3ac
5
5
  SHA512:
6
- metadata.gz: ab4bd63eb1f5b083f70201c9c497124bcfef7020ef3faa8a721e29d681e21942fc7d67ec5492a8c1b8feed89c553584113d7072d04889cec782a0a4fe6c3c74d
7
- data.tar.gz: eaff3fcd4f35c6ad742176d3baaf4c0011d3cf09a70ed9b909ac81cda0b752cf714106817ed77a0bf1eb2b4c59b962851ec3fd3cd44eba7875a3e4380dcdc7e7
6
+ metadata.gz: c6adc7145c9c71c2a8cfb898cadc91a47d9f16bf859c9697a9d3e8c86e8b5365576e48733f7102e77974cf50a78fac600fd9a14853776e65b3215663b9706740
7
+ data.tar.gz: 9c0b6696af75fef45ecf94e81fb3dced2d415c9be7e881cf566c1262831e618b94232187a81a64dfd90e2573d04e57e579b3bd075b9bdcea0dba412bfc4ee0f9
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.37] - 2025-12-10
10
+ ## [2.0.39] - 2025-12-10
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.37...HEAD
28
- [2.0.37]: https://github.com/factpulse/sdk-ruby/releases/tag/v2.0.37
27
+ [Unreleased]: https://github.com/factpulse/sdk-ruby/compare/v2.0.39...HEAD
28
+ [2.0.39]: https://github.com/factpulse/sdk-ruby/releases/tag/v2.0.39
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- factpulse (2.0.37)
4
+ factpulse (2.0.39)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -0,0 +1,28 @@
1
+ # FactPulse::Beneficiaire
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **nom** | **String** | Nom du bénéficiaire (BT-59). Obligatoire. | |
8
+ | **siret** | **String** | | [optional] |
9
+ | **siren** | **String** | | [optional] |
10
+ | **adresse_electronique** | [**AdresseElectronique**](AdresseElectronique.md) | | [optional] |
11
+ | **iban** | **String** | | [optional] |
12
+ | **bic** | **String** | | [optional] |
13
+
14
+ ## Example
15
+
16
+ ```ruby
17
+ require 'factpulse'
18
+
19
+ instance = FactPulse::Beneficiaire.new(
20
+ nom: null,
21
+ siret: null,
22
+ siren: null,
23
+ adresse_electronique: null,
24
+ iban: null,
25
+ bic: null
26
+ )
27
+ ```
28
+
@@ -19,6 +19,7 @@
19
19
  | **commentaire** | **String** | | [optional] |
20
20
  | **id_utilisateur_courant** | **Integer** | | [optional] |
21
21
  | **pieces_jointes_complementaires** | [**Array<PieceJointeComplementaire>**](PieceJointeComplementaire.md) | | [optional] |
22
+ | **beneficiaire** | [**Beneficiaire**](Beneficiaire.md) | | [optional] |
22
23
 
23
24
  ## Example
24
25
 
@@ -40,7 +41,8 @@ instance = FactPulse::FactureFacturX.new(
40
41
  notes: null,
41
42
  commentaire: null,
42
43
  id_utilisateur_courant: null,
43
- pieces_jointes_complementaires: null
44
+ pieces_jointes_complementaires: null,
45
+ beneficiaire: null
44
46
  )
45
47
  ```
46
48
 
@@ -127,6 +127,39 @@ module FactPulse
127
127
  result['codeServiceExecutant'] = options[:code_service_executant] if options[:code_service_executant]
128
128
  result
129
129
  end
130
+
131
+ # Crée un bénéficiaire (factor) pour l'affacturage.
132
+ #
133
+ # Le bénéficiaire (BG-10 / PayeeTradeParty) est utilisé lorsque le paiement
134
+ # doit être effectué à un tiers différent du fournisseur, typiquement un
135
+ # factor (société d'affacturage).
136
+ #
137
+ # Pour les factures affacturées, il faut aussi:
138
+ # - Utiliser un type de document affacturé (393, 396, 501, 502, 472, 473)
139
+ # - Ajouter une note ACC avec la mention de subrogation
140
+ # - L'IBAN du bénéficiaire sera utilisé pour le paiement
141
+ #
142
+ # @param nom [String] Raison sociale du factor (BT-59)
143
+ # @param options [Hash] Options: :siret (BT-60), :siren (BT-61), :iban, :bic
144
+ # @return [Hash] Dict prêt à être utilisé dans une facture affacturée
145
+ #
146
+ # @example
147
+ # factor = beneficiaire('FACTOR SAS',
148
+ # siret: '30000000700033',
149
+ # iban: 'FR76 3000 4000 0500 0012 3456 789'
150
+ # )
151
+ def self.beneficiaire(nom, **options)
152
+ # Auto-calcul SIREN depuis SIRET
153
+ siret = options[:siret]
154
+ siren = options[:siren] || (siret && siret.length == 14 ? siret[0, 9] : nil)
155
+
156
+ result = { 'nom' => nom }
157
+ result['siret'] = siret if siret
158
+ result['siren'] = siren if siren
159
+ result['iban'] = options[:iban] if options[:iban]
160
+ result['bic'] = options[:bic] if options[:bic]
161
+ result
162
+ end
130
163
  end
131
164
 
132
165
  class FactPulseClient
@@ -227,8 +260,37 @@ module FactPulse
227
260
  end
228
261
 
229
262
  unless response.is_a?(Net::HTTPSuccess)
230
- error_data = JSON.parse(response.body) rescue { 'detail' => response.body }
231
- raise FactPulseValidationError.new("Erreur API: #{error_data['detail'] || response.body}")
263
+ # Extraire les détails d'erreur du corps de la réponse
264
+ error_msg = "Erreur API (#{response.code})"
265
+ errors = []
266
+
267
+ begin
268
+ error_data = JSON.parse(response.body)
269
+ # Format FastAPI/Pydantic: {"detail": [{"loc": [...], "msg": "...", "type": "..."}]}
270
+ if error_data['detail'].is_a?(Array)
271
+ error_msg = 'Erreur de validation'
272
+ error_data['detail'].each do |err|
273
+ next unless err.is_a?(Hash)
274
+ loc = (err['loc'] || []).map(&:to_s).join(' -> ')
275
+ errors << ValidationErrorDetail.new(
276
+ level: 'ERROR',
277
+ item: loc,
278
+ reason: err['msg'] || err.to_s,
279
+ source: 'validation',
280
+ code: err['type']
281
+ )
282
+ end
283
+ elsif error_data['detail'].is_a?(String)
284
+ error_msg = error_data['detail']
285
+ elsif error_data['errorMessage']
286
+ error_msg = error_data['errorMessage']
287
+ end
288
+ rescue JSON::ParserError
289
+ error_msg = "Erreur API (#{response.code}): #{response.body}"
290
+ end
291
+
292
+ warn "Erreur API #{response.code}: #{response.body}"
293
+ raise FactPulseValidationError.new(error_msg, errors)
232
294
  end
233
295
 
234
296
  data = JSON.parse(response.body)
@@ -0,0 +1,259 @@
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
+ # Informations sur le bénéficiaire du paiement (BG-10 / PayeeTradeParty). Le bénéficiaire est la partie qui reçoit le paiement. Ce bloc est utilisé uniquement si le bénéficiaire est différent du vendeur (fournisseur). **Cas d'usage principal** : Affacturage (factoring) Quand une facture est affacturée, le factor (société d'affacturage) devient le bénéficiaire du paiement à la place du fournisseur. **Business Terms (EN16931)** : - BT-59 : Nom du bénéficiaire (obligatoire) - BT-60 : Identifiant du bénéficiaire (SIRET avec schemeID 0009) - BT-61 : Identifiant légal du bénéficiaire (SIREN avec schemeID 0002) **Référence** : docs/guide_affacturage.md
18
+ class Beneficiaire < ApiModelBase
19
+ # Nom du bénéficiaire (BT-59). Obligatoire.
20
+ attr_accessor :nom
21
+
22
+ attr_accessor :siret
23
+
24
+ attr_accessor :siren
25
+
26
+ attr_accessor :adresse_electronique
27
+
28
+ attr_accessor :iban
29
+
30
+ attr_accessor :bic
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'nom' => :'nom',
36
+ :'siret' => :'siret',
37
+ :'siren' => :'siren',
38
+ :'adresse_electronique' => :'adresseElectronique',
39
+ :'iban' => :'iban',
40
+ :'bic' => :'bic'
41
+ }
42
+ end
43
+
44
+ # Returns attribute mapping this model knows about
45
+ def self.acceptable_attribute_map
46
+ attribute_map
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ acceptable_attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'nom' => :'String',
58
+ :'siret' => :'String',
59
+ :'siren' => :'String',
60
+ :'adresse_electronique' => :'AdresseElectronique',
61
+ :'iban' => :'String',
62
+ :'bic' => :'String'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ :'siret',
70
+ :'siren',
71
+ :'adresse_electronique',
72
+ :'iban',
73
+ :'bic'
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::Beneficiaire` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::Beneficiaire`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'nom')
94
+ self.nom = attributes[:'nom']
95
+ else
96
+ self.nom = nil
97
+ end
98
+
99
+ if attributes.key?(:'siret')
100
+ self.siret = attributes[:'siret']
101
+ end
102
+
103
+ if attributes.key?(:'siren')
104
+ self.siren = attributes[:'siren']
105
+ end
106
+
107
+ if attributes.key?(:'adresse_electronique')
108
+ self.adresse_electronique = attributes[:'adresse_electronique']
109
+ end
110
+
111
+ if attributes.key?(:'iban')
112
+ self.iban = attributes[:'iban']
113
+ end
114
+
115
+ if attributes.key?(:'bic')
116
+ self.bic = attributes[:'bic']
117
+ end
118
+ end
119
+
120
+ # Show invalid properties with the reasons. Usually used together with valid?
121
+ # @return Array for valid properties with the reasons
122
+ def list_invalid_properties
123
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
124
+ invalid_properties = Array.new
125
+ if @nom.nil?
126
+ invalid_properties.push('invalid value for "nom", nom cannot be nil.')
127
+ end
128
+
129
+ if @nom.to_s.length < 1
130
+ invalid_properties.push('invalid value for "nom", the character length must be greater than or equal to 1.')
131
+ end
132
+
133
+ pattern = Regexp.new(/^\d{14}$/)
134
+ if !@siret.nil? && @siret !~ pattern
135
+ invalid_properties.push("invalid value for \"siret\", must conform to the pattern #{pattern}.")
136
+ end
137
+
138
+ pattern = Regexp.new(/^\d{9}$/)
139
+ if !@siren.nil? && @siren !~ pattern
140
+ invalid_properties.push("invalid value for \"siren\", must conform to the pattern #{pattern}.")
141
+ end
142
+
143
+ invalid_properties
144
+ end
145
+
146
+ # Check to see if the all the properties in the model are valid
147
+ # @return true if the model is valid
148
+ def valid?
149
+ warn '[DEPRECATED] the `valid?` method is obsolete'
150
+ return false if @nom.nil?
151
+ return false if @nom.to_s.length < 1
152
+ return false if !@siret.nil? && @siret !~ Regexp.new(/^\d{14}$/)
153
+ return false if !@siren.nil? && @siren !~ Regexp.new(/^\d{9}$/)
154
+ true
155
+ end
156
+
157
+ # Custom attribute writer method with validation
158
+ # @param [Object] nom Value to be assigned
159
+ def nom=(nom)
160
+ if nom.nil?
161
+ fail ArgumentError, 'nom cannot be nil'
162
+ end
163
+
164
+ if nom.to_s.length < 1
165
+ fail ArgumentError, 'invalid value for "nom", the character length must be greater than or equal to 1.'
166
+ end
167
+
168
+ @nom = nom
169
+ end
170
+
171
+ # Custom attribute writer method with validation
172
+ # @param [Object] siret Value to be assigned
173
+ def siret=(siret)
174
+ pattern = Regexp.new(/^\d{14}$/)
175
+ if !siret.nil? && siret !~ pattern
176
+ fail ArgumentError, "invalid value for \"siret\", must conform to the pattern #{pattern}."
177
+ end
178
+
179
+ @siret = siret
180
+ end
181
+
182
+ # Custom attribute writer method with validation
183
+ # @param [Object] siren Value to be assigned
184
+ def siren=(siren)
185
+ pattern = Regexp.new(/^\d{9}$/)
186
+ if !siren.nil? && siren !~ pattern
187
+ fail ArgumentError, "invalid value for \"siren\", must conform to the pattern #{pattern}."
188
+ end
189
+
190
+ @siren = siren
191
+ end
192
+
193
+ # Checks equality by comparing each attribute.
194
+ # @param [Object] Object to be compared
195
+ def ==(o)
196
+ return true if self.equal?(o)
197
+ self.class == o.class &&
198
+ nom == o.nom &&
199
+ siret == o.siret &&
200
+ siren == o.siren &&
201
+ adresse_electronique == o.adresse_electronique &&
202
+ iban == o.iban &&
203
+ bic == o.bic
204
+ end
205
+
206
+ # @see the `==` method
207
+ # @param [Object] Object to be compared
208
+ def eql?(o)
209
+ self == o
210
+ end
211
+
212
+ # Calculates hash code according to all attributes.
213
+ # @return [Integer] Hash code
214
+ def hash
215
+ [nom, siret, siren, adresse_electronique, iban, bic].hash
216
+ end
217
+
218
+ # Builds the object from hash
219
+ # @param [Hash] attributes Model attributes in the form of hash
220
+ # @return [Object] Returns the model itself
221
+ def self.build_from_hash(attributes)
222
+ return nil unless attributes.is_a?(Hash)
223
+ attributes = attributes.transform_keys(&:to_sym)
224
+ transformed_hash = {}
225
+ openapi_types.each_pair do |key, type|
226
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
227
+ transformed_hash["#{key}"] = nil
228
+ elsif type =~ /\AArray<(.*)>/i
229
+ # check to ensure the input is an array given that the attribute
230
+ # is documented as an array but the input is not
231
+ if attributes[attribute_map[key]].is_a?(Array)
232
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
233
+ end
234
+ elsif !attributes[attribute_map[key]].nil?
235
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
236
+ end
237
+ end
238
+ new(transformed_hash)
239
+ end
240
+
241
+ # Returns the object in the form of hash
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_hash
244
+ hash = {}
245
+ self.class.attribute_map.each_pair do |attr, param|
246
+ value = self.send(attr)
247
+ if value.nil?
248
+ is_nullable = self.class.openapi_nullable.include?(attr)
249
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
250
+ end
251
+
252
+ hash[param] = _to_hash(value)
253
+ end
254
+ hash
255
+ end
256
+
257
+ end
258
+
259
+ end
@@ -65,6 +65,7 @@ module FactPulse
65
65
  # List of attributes with nullable: true
66
66
  def self.openapi_nullable
67
67
  Set.new([
68
+ :'adresse_electronique',
68
69
  :'code_service_executant',
69
70
  :'nom',
70
71
  :'siren',
@@ -121,10 +122,6 @@ module FactPulse
121
122
  def list_invalid_properties
122
123
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
123
124
  invalid_properties = Array.new
124
- if @adresse_electronique.nil?
125
- invalid_properties.push('invalid value for "adresse_electronique", adresse_electronique cannot be nil.')
126
- end
127
-
128
125
  invalid_properties
129
126
  end
130
127
 
@@ -132,20 +129,9 @@ module FactPulse
132
129
  # @return true if the model is valid
133
130
  def valid?
134
131
  warn '[DEPRECATED] the `valid?` method is obsolete'
135
- return false if @adresse_electronique.nil?
136
132
  true
137
133
  end
138
134
 
139
- # Custom attribute writer method with validation
140
- # @param [Object] adresse_electronique Value to be assigned
141
- def adresse_electronique=(adresse_electronique)
142
- if adresse_electronique.nil?
143
- fail ArgumentError, 'adresse_electronique cannot be nil'
144
- end
145
-
146
- @adresse_electronique = adresse_electronique
147
- end
148
-
149
135
  # Checks equality by comparing each attribute.
150
136
  # @param [Object] Object to be compared
151
137
  def ==(o)
@@ -46,6 +46,8 @@ module FactPulse
46
46
 
47
47
  attr_accessor :pieces_jointes_complementaires
48
48
 
49
+ attr_accessor :beneficiaire
50
+
49
51
  class EnumAttributeValidator
50
52
  attr_reader :datatype
51
53
  attr_reader :allowable_values
@@ -85,7 +87,8 @@ module FactPulse
85
87
  :'notes' => :'notes',
86
88
  :'commentaire' => :'commentaire',
87
89
  :'id_utilisateur_courant' => :'idUtilisateurCourant',
88
- :'pieces_jointes_complementaires' => :'piecesJointesComplementaires'
90
+ :'pieces_jointes_complementaires' => :'piecesJointesComplementaires',
91
+ :'beneficiaire' => :'beneficiaire'
89
92
  }
90
93
  end
91
94
 
@@ -116,7 +119,8 @@ module FactPulse
116
119
  :'notes' => :'Array<Note>',
117
120
  :'commentaire' => :'String',
118
121
  :'id_utilisateur_courant' => :'Integer',
119
- :'pieces_jointes_complementaires' => :'Array<PieceJointeComplementaire>'
122
+ :'pieces_jointes_complementaires' => :'Array<PieceJointeComplementaire>',
123
+ :'beneficiaire' => :'Beneficiaire'
120
124
  }
121
125
  end
122
126
 
@@ -125,7 +129,8 @@ module FactPulse
125
129
  Set.new([
126
130
  :'commentaire',
127
131
  :'id_utilisateur_courant',
128
- :'pieces_jointes_complementaires'
132
+ :'pieces_jointes_complementaires',
133
+ :'beneficiaire'
129
134
  ])
130
135
  end
131
136
 
@@ -228,6 +233,10 @@ module FactPulse
228
233
  self.pieces_jointes_complementaires = value
229
234
  end
230
235
  end
236
+
237
+ if attributes.key?(:'beneficiaire')
238
+ self.beneficiaire = attributes[:'beneficiaire']
239
+ end
231
240
  end
232
241
 
233
242
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -384,7 +393,8 @@ module FactPulse
384
393
  notes == o.notes &&
385
394
  commentaire == o.commentaire &&
386
395
  id_utilisateur_courant == o.id_utilisateur_courant &&
387
- pieces_jointes_complementaires == o.pieces_jointes_complementaires
396
+ pieces_jointes_complementaires == o.pieces_jointes_complementaires &&
397
+ beneficiaire == o.beneficiaire
388
398
  end
389
399
 
390
400
  # @see the `==` method
@@ -396,7 +406,7 @@ module FactPulse
396
406
  # Calculates hash code according to all attributes.
397
407
  # @return [Integer] Hash code
398
408
  def hash
399
- [numero_facture, date_echeance_paiement, date_facture, mode_depot, destinataire, fournisseur, cadre_de_facturation, references, montant_total, lignes_de_poste, lignes_de_tva, notes, commentaire, id_utilisateur_courant, pieces_jointes_complementaires].hash
409
+ [numero_facture, date_echeance_paiement, date_facture, mode_depot, destinataire, fournisseur, cadre_de_facturation, references, montant_total, lignes_de_poste, lignes_de_tva, notes, commentaire, id_utilisateur_courant, pieces_jointes_complementaires, beneficiaire].hash
400
410
  end
401
411
 
402
412
  # Builds the object from hash
@@ -81,6 +81,7 @@ module FactPulse
81
81
  # List of attributes with nullable: true
82
82
  def self.openapi_nullable
83
83
  Set.new([
84
+ :'adresse_electronique',
84
85
  :'code_coordonnees_bancaires_fournisseur',
85
86
  :'id_service_fournisseur',
86
87
  :'nom',
@@ -158,10 +159,6 @@ module FactPulse
158
159
  def list_invalid_properties
159
160
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
160
161
  invalid_properties = Array.new
161
- if @adresse_electronique.nil?
162
- invalid_properties.push('invalid value for "adresse_electronique", adresse_electronique cannot be nil.')
163
- end
164
-
165
162
  if @id_fournisseur.nil?
166
163
  invalid_properties.push('invalid value for "id_fournisseur", id_fournisseur cannot be nil.')
167
164
  end
@@ -173,21 +170,10 @@ module FactPulse
173
170
  # @return true if the model is valid
174
171
  def valid?
175
172
  warn '[DEPRECATED] the `valid?` method is obsolete'
176
- return false if @adresse_electronique.nil?
177
173
  return false if @id_fournisseur.nil?
178
174
  true
179
175
  end
180
176
 
181
- # Custom attribute writer method with validation
182
- # @param [Object] adresse_electronique Value to be assigned
183
- def adresse_electronique=(adresse_electronique)
184
- if adresse_electronique.nil?
185
- fail ArgumentError, 'adresse_electronique cannot be nil'
186
- end
187
-
188
- @adresse_electronique = adresse_electronique
189
- end
190
-
191
177
  # Custom attribute writer method with validation
192
178
  # @param [Object] id_fournisseur Value to be assigned
193
179
  def id_fournisseur=(id_fournisseur)
@@ -15,11 +15,25 @@ require 'time'
15
15
 
16
16
  module FactPulse
17
17
  class TypeFacture
18
- FACTURE = "FACTURE".freeze
19
- AVOIR = "AVOIR".freeze
18
+ N380 = "380".freeze
19
+ N389 = "389".freeze
20
+ N393 = "393".freeze
21
+ N501 = "501".freeze
22
+ N386 = "386".freeze
23
+ N500 = "500".freeze
24
+ N384 = "384".freeze
25
+ N471 = "471".freeze
26
+ N472 = "472".freeze
27
+ N473 = "473".freeze
28
+ N381 = "381".freeze
29
+ N261 = "261".freeze
30
+ N262 = "262".freeze
31
+ N396 = "396".freeze
32
+ N502 = "502".freeze
33
+ N503 = "503".freeze
20
34
 
21
35
  def self.all_vars
22
- @all_vars ||= [FACTURE, AVOIR].freeze
36
+ @all_vars ||= [N380, N389, N393, N501, N386, N500, N384, N471, N472, N473, N381, N261, N262, N396, N502, N503].freeze
23
37
  end
24
38
 
25
39
  # Builds the enum from string
@@ -11,5 +11,5 @@ Generator version: 7.18.0-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module FactPulse
14
- VERSION = '2.0.37'
14
+ VERSION = '2.0.39'
15
15
  end
data/lib/factpulse.rb CHANGED
@@ -21,6 +21,7 @@ require 'factpulse/configuration'
21
21
  require 'factpulse/models/api_error'
22
22
  require 'factpulse/models/adresse_electronique'
23
23
  require 'factpulse/models/adresse_postale'
24
+ require 'factpulse/models/beneficiaire'
24
25
  require 'factpulse/models/bounding_box_schema'
25
26
  require 'factpulse/models/cadre_de_facturation'
26
27
  require 'factpulse/models/categorie_tva'
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.37
4
+ version: 2.0.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
@@ -128,6 +128,7 @@ files:
128
128
  - docs/APIError.md
129
129
  - docs/AdresseElectronique.md
130
130
  - docs/AdressePostale.md
131
+ - docs/Beneficiaire.md
131
132
  - docs/BoundingBoxSchema.md
132
133
  - docs/CadreDeFacturation.md
133
134
  - docs/CategorieTVA.md
@@ -260,6 +261,7 @@ files:
260
261
  - lib/factpulse/models/adresse_electronique.rb
261
262
  - lib/factpulse/models/adresse_postale.rb
262
263
  - lib/factpulse/models/api_error.rb
264
+ - lib/factpulse/models/beneficiaire.rb
263
265
  - lib/factpulse/models/bounding_box_schema.rb
264
266
  - lib/factpulse/models/cadre_de_facturation.rb
265
267
  - lib/factpulse/models/categorie_tva.rb