factpulse 3.0.29 → 3.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: 04a881e701ac9a5e0b5a83bae874c425a06ce0f8bc42e2747141c6cc910dbe83
4
- data.tar.gz: 57418b7ace370be58d37f6afb118d878c25a0f219562ad53d1a3d25d9029c5ef
3
+ metadata.gz: 94db622879964ed7a06ca11f0bba2ae74bbf8c0bb8ae6ab7f37726340a59578a
4
+ data.tar.gz: a711cb72138be7537ee68eaa62f86235eadcb6c24cab3e126027b807f971b47a
5
5
  SHA512:
6
- metadata.gz: e02ea82aa7555b6ea823ccb440d766a91250150405a77e0d6cfd448644cb52629fddba76304dede6b868625f930dac8d21fdcc4ed2c301581dd3646274792ba7
7
- data.tar.gz: b48ac47c664ef5f1ba7060cb2f54bf33ab4bdd35a6ca779cf3157f0ce33629d9d3270b0bd16c4119ce70aaa7f16eee1c47d3c3bbf87d259dc288f0a6beb0d5e2
6
+ metadata.gz: 34d8698d5e106f9cba5b5d2e05ab6385de8d6688d6bb903fc4033174d9ce438e079e7708bc8504d33d36a7e1758efbd7e655e021a303bdfa1116b8f95fc1d483
7
+ data.tar.gz: 401039a27b602c5364a8a1677a41a3dde46228f57ea02f239ab6af99e9674e7e9feb4607519db7c69cd0206479443a2872a1e4327752be18f90e753ce0ecff56
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
- ## [3.0.29] - 2026-01-16
10
+ ## [3.0.31] - 2026-01-16
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/v3.0.29...HEAD
28
- [3.0.29]: https://github.com/factpulse/sdk-ruby/releases/tag/v3.0.29
27
+ [Unreleased]: https://github.com/factpulse/sdk-ruby/compare/v3.0.31...HEAD
28
+ [3.0.31]: https://github.com/factpulse/sdk-ruby/releases/tag/v3.0.31
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- factpulse (3.0.29)
4
+ factpulse (3.0.31)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -24,18 +24,17 @@ gem 'factpulse'
24
24
 
25
25
  ## Quick Start
26
26
 
27
- The `helpers` module provides a simplified API with automatic authentication and polling:
27
+ The `FactPulse::Helpers` module provides a simplified API with automatic authentication and polling:
28
28
 
29
29
  ```ruby
30
30
  require 'factpulse'
31
- require 'factpulse/helpers'
32
31
 
33
- include Factpulse::Helpers
32
+ include FactPulse::Helpers
34
33
 
35
34
  # Create the client
36
35
  client = FactPulseClient.new(
37
- 'your_email@example.com',
38
- 'your_password'
36
+ email: 'your_email@example.com',
37
+ password: 'your_password'
39
38
  )
40
39
 
41
40
  # Build the invoice using simplified format (auto-calculates totals)
@@ -66,18 +65,18 @@ pdf_bytes = client.generate_facturx(invoice_data, 'source_invoice.pdf')
66
65
  File.binwrite('invoice_facturx.pdf', pdf_bytes)
67
66
  ```
68
67
 
69
- ## Available Helpers (Factpulse::Helpers module)
68
+ ## Available Helpers (FactPulse::Helpers::AmountHelpers module)
70
69
 
71
70
  ### amount(value)
72
71
 
73
72
  Converts a value to a formatted string for monetary amounts.
74
73
 
75
74
  ```ruby
76
- include Factpulse::Helpers
75
+ include FactPulse::Helpers
77
76
 
78
- amount(1234.5) # "1234.50"
79
- amount('1234.56') # "1234.56"
80
- amount(nil) # "0.00"
77
+ AmountHelpers.amount(1234.5) # "1234.50"
78
+ AmountHelpers.amount('1234.56') # "1234.56"
79
+ AmountHelpers.amount(nil) # "0.00"
81
80
  ```
82
81
 
83
82
  ### invoice_totals(excl_tax, vat, incl_tax, amount_due, ...)
@@ -85,7 +84,7 @@ amount(nil) # "0.00"
85
84
  Creates a complete invoice totals object.
86
85
 
87
86
  ```ruby
88
- totals = invoice_totals(
87
+ totals = AmountHelpers.invoice_totals(
89
88
  1000.00, # excl_tax
90
89
  200.00, # vat
91
90
  1200.00, # incl_tax
@@ -96,36 +95,34 @@ totals = invoice_totals(
96
95
  )
97
96
  ```
98
97
 
99
- ### invoice_line(line_number, item_name, quantity, unit_net_price, line_net_amount, ...)
98
+ ### invoice_line(number, description, quantity, unit_price_excl_tax, line_total_excl_tax, ...)
100
99
 
101
100
  Creates an invoice line.
102
101
 
103
102
  ```ruby
104
- line = invoice_line(
103
+ line = AmountHelpers.invoice_line(
105
104
  1,
106
105
  'Consulting services',
107
106
  5,
108
107
  200.00,
109
108
  1000.00,
110
- 'S', # vat_category: S, Z, E, AE, K
111
- 'HOUR', # unit: LUMP_SUM, PIECE, HOUR, DAY...
112
- {
113
- vat_rate: 'TVA20', # Or manual_vat_rate: '20.00'
114
- reference: 'REF-001'
115
- }
109
+ vat_rate: '20.00', # vatRateManual
110
+ vat_category: 'S', # S, Z, E, AE, K
111
+ unit: 'LUMP_SUM', # LUMP_SUM, PIECE, HOUR, DAY...
112
+ reference: 'REF-001' # optional
116
113
  )
117
114
  ```
118
115
 
119
- ### vat_line(taxable_amount, vat_amount, ...)
116
+ ### vat_line(rate_manual, base_amount_excl_tax, vat_amount, category)
120
117
 
121
118
  Creates a VAT breakdown line.
122
119
 
123
120
  ```ruby
124
- vat = vat_line(
125
- 1000.00, # taxable_amount
121
+ vat = AmountHelpers.vat_line(
122
+ '20.00', # rate_manual
123
+ 1000.00, # base_amount_excl_tax
126
124
  200.00, # vat_amount
127
- 'S', # category: S, Z, E, AE, K
128
- { rate: 'TVA20' } # Or manual_rate: '20.00'
125
+ category: 'S' # S, Z, E, AE, K
129
126
  )
130
127
  ```
131
128
 
@@ -134,12 +131,12 @@ vat = vat_line(
134
131
  Creates a structured postal address.
135
132
 
136
133
  ```ruby
137
- address = postal_address(
134
+ address = AmountHelpers.postal_address(
138
135
  '123 Republic Street',
139
136
  '75001',
140
137
  'Paris',
141
- 'FR', # country (default: 'FR')
142
- 'Building A' # line2 (optional)
138
+ country: 'FR', # default: 'FR'
139
+ line2: 'Building A' # optional
143
140
  )
144
141
  ```
145
142
 
@@ -148,13 +145,13 @@ address = postal_address(
148
145
  Creates a complete supplier with automatic calculation of SIREN and intra-community VAT.
149
146
 
150
147
  ```ruby
151
- s = supplier(
148
+ s = AmountHelpers.supplier(
152
149
  'My Company SAS',
153
150
  '12345678901234',
154
151
  '123 Example Street',
155
152
  '75001',
156
153
  'Paris',
157
- { iban: 'FR7630006000011234567890189' }
154
+ iban: 'FR7630006000011234567890189'
158
155
  )
159
156
  # SIREN and intra-community VAT automatically calculated
160
157
  ```
@@ -164,7 +161,7 @@ s = supplier(
164
161
  Creates a recipient (customer) with automatic calculation of SIREN.
165
162
 
166
163
  ```ruby
167
- r = recipient(
164
+ r = AmountHelpers.recipient(
168
165
  'Client SARL',
169
166
  '98765432109876',
170
167
  '456 Test Avenue',
@@ -178,30 +175,28 @@ r = recipient(
178
175
  To pass your own credentials without server-side storage:
179
176
 
180
177
  ```ruby
181
- include Factpulse::Helpers
178
+ include FactPulse::Helpers
182
179
 
183
180
  chorus_creds = ChorusProCredentials.new(
184
- 'your_client_id',
185
- 'your_client_secret',
186
- 'your_login',
187
- 'your_password',
188
- true # sandbox
181
+ piste_client_id: 'your_client_id',
182
+ piste_client_secret: 'your_client_secret',
183
+ chorus_pro_login: 'your_login',
184
+ chorus_pro_password: 'your_password',
185
+ sandbox: true
189
186
  )
190
187
 
191
188
  afnor_creds = AFNORCredentials.new(
192
- 'https://api.pdp.fr/flow/v1',
193
- 'https://auth.pdp.fr/oauth/token',
194
- 'your_client_id',
195
- 'your_client_secret'
189
+ flow_service_url: 'https://api.pdp.fr/flow/v1',
190
+ token_url: 'https://auth.pdp.fr/oauth/token',
191
+ client_id: 'your_client_id',
192
+ client_secret: 'your_client_secret'
196
193
  )
197
194
 
198
195
  client = FactPulseClient.new(
199
- 'your_email@example.com',
200
- 'your_password',
201
- nil, # api_url
202
- nil, # client_uid
203
- chorus_creds,
204
- afnor_creds
196
+ email: 'your_email@example.com',
197
+ password: 'your_password',
198
+ chorus_credentials: chorus_creds,
199
+ afnor_credentials: afnor_creds
205
200
  )
206
201
  ```
207
202
 
@@ -0,0 +1,15 @@
1
+ # FactPulse::FactureElectroniqueModelsInvoiceTypeCode
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+
8
+ ## Example
9
+
10
+ ```ruby
11
+ require 'factpulse'
12
+
13
+ instance = FactPulse::FactureElectroniqueModelsInvoiceTypeCode.new()
14
+ ```
15
+
data/docs/InvoiceInput.md CHANGED
@@ -6,7 +6,7 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **invoice_id** | **String** | Invoice identifier | |
8
8
  | **issue_date** | **Date** | Invoice issue date | |
9
- | **type_code** | [**FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode**](FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md) | Invoice type code | [optional] |
9
+ | **type_code** | [**InvoiceTypeCode**](InvoiceTypeCode.md) | Invoice type code | [optional] |
10
10
  | **currency** | [**Currency**](Currency.md) | | [optional] |
11
11
  | **due_date** | **Date** | | [optional] |
12
12
  | **seller_siren** | **String** | Seller SIREN/SIRET | |
@@ -13,7 +13,7 @@
13
13
  | **comment** | **String** | | [optional] |
14
14
  | **purchase_order_reference** | **String** | | [optional] |
15
15
  | **contract_reference** | **String** | | [optional] |
16
- | **invoice_type** | [**InvoiceTypeCode**](InvoiceTypeCode.md) | Document type (UNTDID 1001). Default: 380 (Invoice). | [optional] |
16
+ | **invoice_type** | [**FactureElectroniqueModelsInvoiceTypeCode**](FactureElectroniqueModelsInvoiceTypeCode.md) | Document type (UNTDID 1001). Default: 380 (Invoice). | [optional] |
17
17
  | **preceding_invoice_reference** | **String** | | [optional] |
18
18
  | **operation_nature** | [**OperationNature**](OperationNature.md) | | [optional] |
19
19
  | **invoicing_framework** | [**InvoicingFrameworkCode**](InvoicingFrameworkCode.md) | | [optional] |
@@ -561,14 +561,21 @@ module FactPulse
561
561
  end
562
562
 
563
563
  # Submits an invoice to Chorus Pro.
564
- def soumettre_facture_chorus(facture_data)
565
- make_chorus_request('POST', '/factures/soumettre', facture_data)
564
+ # @param invoice_data [Hash] Invoice data with keys: numero_facture, date_facture, date_echeance_paiement,
565
+ # id_structure_cpp, montant_ht_total, montant_tva, montant_ttc_total, etc.
566
+ # @return [Hash] Response with identifiant_facture_cpp, numero_flux_depot, code_retour, libelle
567
+ def submit_invoice_chorus(invoice_data)
568
+ make_chorus_request('POST', '/factures/soumettre', invoice_data)
566
569
  end
570
+ alias soumettre_facture_chorus submit_invoice_chorus
567
571
 
568
572
  # Gets the status of a Chorus Pro invoice.
569
- def consulter_facture_chorus(identifiant_facture_cpp)
570
- make_chorus_request('POST', '/factures/consulter', { 'identifiant_facture_cpp' => identifiant_facture_cpp })
573
+ # @param invoice_cpp_id [Integer] Chorus Pro invoice ID
574
+ # @return [Hash] Invoice status with statut_courant, numero_facture, date_facture, etc.
575
+ def get_invoice_status_chorus(invoice_cpp_id)
576
+ make_chorus_request('POST', '/factures/consulter', { 'identifiant_facture_cpp' => invoice_cpp_id })
571
577
  end
578
+ alias consulter_facture_chorus get_invoice_status_chorus
572
579
 
573
580
  # =========================================================================
574
581
  # Validation
@@ -14,15 +14,26 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module FactPulse
17
- class FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode
18
- N380 = "380".freeze
19
- N381 = "381".freeze
20
- N384 = "384".freeze
21
- N389 = "389".freeze
22
- N386 = "386".freeze
17
+ class FactureElectroniqueModelsInvoiceTypeCode
18
+ INVOICE = "380".freeze
19
+ SELF_BILLED_INVOICE = "389".freeze
20
+ FACTORED_INVOICE = "393".freeze
21
+ SELF_BILLED_FACTORED_INVOICE = "501".freeze
22
+ PREPAYMENT_INVOICE = "386".freeze
23
+ SELF_BILLED_PREPAYMENT_INVOICE = "500".freeze
24
+ CORRECTIVE_INVOICE = "384".freeze
25
+ SELF_BILLED_CORRECTIVE_INVOICE = "471".freeze
26
+ FACTORED_CORRECTIVE_INVOICE = "472".freeze
27
+ SELF_BILLED_FACTORED_CORRECTIVE_INVOICE = "473".freeze
28
+ CREDIT_NOTE = "381".freeze
29
+ SELF_BILLED_CREDIT_NOTE = "261".freeze
30
+ GLOBAL_ALLOWANCE_CREDIT_NOTE = "262".freeze
31
+ FACTORED_CREDIT_NOTE = "396".freeze
32
+ SELF_BILLED_FACTORED_CREDIT_NOTE = "502".freeze
33
+ PREPAYMENT_CREDIT_NOTE = "503".freeze
23
34
 
24
35
  def self.all_vars
25
- @all_vars ||= [N380, N381, N384, N389, N386].freeze
36
+ @all_vars ||= [INVOICE, SELF_BILLED_INVOICE, FACTORED_INVOICE, SELF_BILLED_FACTORED_INVOICE, PREPAYMENT_INVOICE, SELF_BILLED_PREPAYMENT_INVOICE, CORRECTIVE_INVOICE, SELF_BILLED_CORRECTIVE_INVOICE, FACTORED_CORRECTIVE_INVOICE, SELF_BILLED_FACTORED_CORRECTIVE_INVOICE, CREDIT_NOTE, SELF_BILLED_CREDIT_NOTE, GLOBAL_ALLOWANCE_CREDIT_NOTE, FACTORED_CREDIT_NOTE, SELF_BILLED_FACTORED_CREDIT_NOTE, PREPAYMENT_CREDIT_NOTE].freeze
26
37
  end
27
38
 
28
39
  # Builds the enum from string
@@ -36,8 +47,8 @@ module FactPulse
36
47
  # @param [String] The enum value in the form of the string
37
48
  # @return [String] The enum value
38
49
  def build_from_hash(value)
39
- return value if FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.all_vars.include?(value)
40
- raise "Invalid ENUM value #{value} for class #FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode"
50
+ return value if FactureElectroniqueModelsInvoiceTypeCode.all_vars.include?(value)
51
+ raise "Invalid ENUM value #{value} for class #FactureElectroniqueModelsInvoiceTypeCode"
41
52
  end
42
53
  end
43
54
  end
@@ -112,7 +112,7 @@ module FactPulse
112
112
  {
113
113
  :'invoice_id' => :'String',
114
114
  :'issue_date' => :'Date',
115
- :'type_code' => :'FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode',
115
+ :'type_code' => :'InvoiceTypeCode',
116
116
  :'currency' => :'Currency',
117
117
  :'due_date' => :'Date',
118
118
  :'seller_siren' => :'String',
@@ -15,25 +15,14 @@ require 'time'
15
15
 
16
16
  module FactPulse
17
17
  class InvoiceTypeCode
18
- INVOICE = "380".freeze
19
- SELF_BILLED_INVOICE = "389".freeze
20
- FACTORED_INVOICE = "393".freeze
21
- SELF_BILLED_FACTORED_INVOICE = "501".freeze
22
- PREPAYMENT_INVOICE = "386".freeze
23
- SELF_BILLED_PREPAYMENT_INVOICE = "500".freeze
24
- CORRECTIVE_INVOICE = "384".freeze
25
- SELF_BILLED_CORRECTIVE_INVOICE = "471".freeze
26
- FACTORED_CORRECTIVE_INVOICE = "472".freeze
27
- SELF_BILLED_FACTORED_CORRECTIVE_INVOICE = "473".freeze
28
- CREDIT_NOTE = "381".freeze
29
- SELF_BILLED_CREDIT_NOTE = "261".freeze
30
- GLOBAL_ALLOWANCE_CREDIT_NOTE = "262".freeze
31
- FACTORED_CREDIT_NOTE = "396".freeze
32
- SELF_BILLED_FACTORED_CREDIT_NOTE = "502".freeze
33
- PREPAYMENT_CREDIT_NOTE = "503".freeze
18
+ N380 = "380".freeze
19
+ N381 = "381".freeze
20
+ N384 = "384".freeze
21
+ N389 = "389".freeze
22
+ N386 = "386".freeze
34
23
 
35
24
  def self.all_vars
36
- @all_vars ||= [INVOICE, SELF_BILLED_INVOICE, FACTORED_INVOICE, SELF_BILLED_FACTORED_INVOICE, PREPAYMENT_INVOICE, SELF_BILLED_PREPAYMENT_INVOICE, CORRECTIVE_INVOICE, SELF_BILLED_CORRECTIVE_INVOICE, FACTORED_CORRECTIVE_INVOICE, SELF_BILLED_FACTORED_CORRECTIVE_INVOICE, CREDIT_NOTE, SELF_BILLED_CREDIT_NOTE, GLOBAL_ALLOWANCE_CREDIT_NOTE, FACTORED_CREDIT_NOTE, SELF_BILLED_FACTORED_CREDIT_NOTE, PREPAYMENT_CREDIT_NOTE].freeze
25
+ @all_vars ||= [N380, N381, N384, N389, N386].freeze
37
26
  end
38
27
 
39
28
  # Builds the enum from string
@@ -111,7 +111,7 @@ module FactPulse
111
111
  :'comment' => :'String',
112
112
  :'purchase_order_reference' => :'String',
113
113
  :'contract_reference' => :'String',
114
- :'invoice_type' => :'InvoiceTypeCode',
114
+ :'invoice_type' => :'FactureElectroniqueModelsInvoiceTypeCode',
115
115
  :'preceding_invoice_reference' => :'String',
116
116
  :'operation_nature' => :'OperationNature',
117
117
  :'invoicing_framework' => :'InvoicingFrameworkCode'
@@ -11,5 +11,5 @@ Generator version: 7.19.0-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module FactPulse
14
- VERSION = '3.0.29'
14
+ VERSION = '3.0.31'
15
15
  end
data/lib/factpulse.rb CHANGED
@@ -158,7 +158,7 @@ require 'factpulse/models/error_source'
158
158
  require 'factpulse/models/extraction_info'
159
159
  require 'factpulse/models/factur_x_invoice'
160
160
  require 'factpulse/models/factur_xpdf_info'
161
- require 'factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code'
161
+ require 'factpulse/models/facture_electronique_models_invoice_type_code'
162
162
  require 'factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials'
163
163
  require 'factpulse/models/field_status'
164
164
  require 'factpulse/models/file_info'
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: 3.0.29
4
+ version: 3.0.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
@@ -263,7 +263,7 @@ files:
263
263
  - docs/ExtractionInfo.md
264
264
  - docs/FacturXInvoice.md
265
265
  - docs/FacturXPDFInfo.md
266
- - docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md
266
+ - docs/FactureElectroniqueModelsInvoiceTypeCode.md
267
267
  - docs/FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md
268
268
  - docs/FieldStatus.md
269
269
  - docs/FileInfo.md
@@ -562,7 +562,7 @@ files:
562
562
  - lib/factpulse/models/extraction_info.rb
563
563
  - lib/factpulse/models/factur_x_invoice.rb
564
564
  - lib/factpulse/models/factur_xpdf_info.rb
565
- - lib/factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code.rb
565
+ - lib/factpulse/models/facture_electronique_models_invoice_type_code.rb
566
566
  - lib/factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb
567
567
  - lib/factpulse/models/field_status.rb
568
568
  - lib/factpulse/models/file_info.rb
@@ -1,15 +0,0 @@
1
- # FactPulse::FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
-
8
- ## Example
9
-
10
- ```ruby
11
- require 'factpulse'
12
-
13
- instance = FactPulse::FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.new()
14
- ```
15
-