factpulse 4.4.0 → 4.5.0
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 +8 -7
- data/Gemfile.lock +9 -9
- data/docs/Amount3.md +15 -0
- data/docs/ChorusProDestination.md +1 -1
- data/docs/ClientManagementApi.md +152 -0
- data/docs/CreateCDARRequest.md +5 -1
- data/docs/ElectronicSignatureApi.md +6 -6
- data/docs/EncaisseAmountByRate.md +20 -0
- data/docs/EncaisseeRequest.md +7 -3
- data/docs/FacturXConversionApi.md +2 -2
- data/docs/FacturXPDFXMLVerificationApi.md +4 -4
- data/docs/FacturXValidationApi.md +4 -4
- data/docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md +15 -0
- data/docs/{ChorusProCredentials.md → FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md} +2 -2
- data/docs/{ValidationErrorResponse.md → FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.md} +2 -2
- data/docs/Flux10EReportingApi.md +4 -4
- data/docs/Flux6InvoiceLifecycleCDARApi.md +8 -4
- data/docs/InvoiceGenerationApi.md +4 -4
- data/docs/InvoiceInput.md +1 -1
- data/docs/LifecycleResponse.md +9 -1
- data/docs/ParseApi.md +4 -4
- data/docs/PaymentAmountByRate.md +1 -1
- data/docs/SubmitCDARRequest.md +4 -0
- data/docs/SuperPDPVatRegimeResponse.md +20 -0
- data/docs/SuperPDPVatRegimeUpdateRequest.md +20 -0
- data/docs/ValidateCDARRequest.md +3 -1
- data/docs/ValidationApi.md +3 -3
- data/docs/ValidationError.md +5 -1
- data/lib/factpulse/api/client_management_api.rb +137 -0
- data/lib/factpulse/api/electronic_signature_api.rb +6 -6
- data/lib/factpulse/api/factur_x_conversion_api.rb +2 -2
- data/lib/factpulse/api/factur_x_validation_api.rb +4 -4
- data/lib/factpulse/api/factur_xpdfxml_verification_api.rb +4 -4
- data/lib/factpulse/api/flux10_e_reporting_api.rb +4 -4
- data/lib/factpulse/api/flux6_invoice_lifecycle_cdar_api.rb +10 -4
- data/lib/factpulse/api/invoice_generation_api.rb +2 -2
- data/lib/factpulse/api/parse_api.rb +4 -4
- data/lib/factpulse/api/validation_api.rb +4 -4
- data/lib/factpulse/models/amount1.rb +1 -1
- data/lib/factpulse/models/amount2.rb +1 -1
- data/lib/factpulse/models/amount3.rb +104 -0
- data/lib/factpulse/models/chorus_pro_destination.rb +1 -1
- data/lib/factpulse/models/create_cdar_request.rb +56 -4
- data/lib/factpulse/models/encaisse_amount_by_rate.rb +192 -0
- data/lib/factpulse/models/encaisseamount.rb +1 -1
- data/lib/factpulse/models/encaissee_request.rb +43 -24
- data/lib/factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code.rb +43 -0
- data/lib/factpulse/models/{chorus_pro_credentials.rb → facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb} +3 -3
- data/lib/factpulse/models/{validation_error_response.rb → facture_electronique_rest_api_schemas_validation_validation_error_response.rb} +3 -3
- data/lib/factpulse/models/invoice_input.rb +1 -1
- data/lib/factpulse/models/invoice_type_code.rb +17 -6
- data/lib/factpulse/models/lifecycle_response.rb +48 -4
- data/lib/factpulse/models/payment_amount_by_rate.rb +1 -1
- data/lib/factpulse/models/payment_means.rb +2 -1
- data/lib/factpulse/models/submit_cdar_request.rb +53 -1
- data/lib/factpulse/models/super_pdp_vat_regime_response.rb +195 -0
- data/lib/factpulse/models/super_pdp_vat_regime_update_request.rb +200 -0
- data/lib/factpulse/models/validate_cdar_request.rb +17 -5
- data/lib/factpulse/models/validation_error.rb +23 -4
- data/lib/factpulse/version.rb +1 -1
- data/lib/factpulse.rb +7 -2
- metadata +16 -6
|
@@ -484,7 +484,7 @@ module FactPulse
|
|
|
484
484
|
|
|
485
485
|
# Submit pre-generated e-reporting XML
|
|
486
486
|
# Submit a pre-generated e-reporting XML file directly to a PA/PDP. This endpoint is designed for clients who generate their own PPF-compliant XML and only need FactPulse for the PDP submission. **Process:** 1. Validates the XML against PPF XSD schemas 2. Determines the appropriate AFNOR FlowType 3. Submits to the configured PDP/PA 4. Returns the flowId for tracking **Authentication:** Same strategies as /submit endpoint (JWT or zero-storage credentials).
|
|
487
|
-
# @param xml_file [
|
|
487
|
+
# @param xml_file [String] E-reporting XML file
|
|
488
488
|
# @param [Hash] opts the optional parameters
|
|
489
489
|
# @option opts [String] :organization_id Organization ID relayed to the PDP (AFNOR XP Z12-013 delegation / multi-tenancy). Required by some PDPs to select the client space.
|
|
490
490
|
# @option opts [String] :tracking_id
|
|
@@ -501,7 +501,7 @@ module FactPulse
|
|
|
501
501
|
|
|
502
502
|
# Submit pre-generated e-reporting XML
|
|
503
503
|
# Submit a pre-generated e-reporting XML file directly to a PA/PDP. This endpoint is designed for clients who generate their own PPF-compliant XML and only need FactPulse for the PDP submission. **Process:** 1. Validates the XML against PPF XSD schemas 2. Determines the appropriate AFNOR FlowType 3. Submits to the configured PDP/PA 4. Returns the flowId for tracking **Authentication:** Same strategies as /submit endpoint (JWT or zero-storage credentials).
|
|
504
|
-
# @param xml_file [
|
|
504
|
+
# @param xml_file [String] E-reporting XML file
|
|
505
505
|
# @param [Hash] opts the optional parameters
|
|
506
506
|
# @option opts [String] :organization_id Organization ID relayed to the PDP (AFNOR XP Z12-013 delegation / multi-tenancy). Required by some PDPs to select the client space.
|
|
507
507
|
# @option opts [String] :tracking_id
|
|
@@ -710,7 +710,7 @@ module FactPulse
|
|
|
710
710
|
|
|
711
711
|
# Validate e-reporting XML (PPF Annexe 6 v1.9 compliant)
|
|
712
712
|
# Validates an e-reporting XML file against PPF specifications (Annexe 6 v1.9): **Validation levels:** 1. **XSD (REJ_SEMAN)**: Structure, types, cardinality 2. **Semantic (REJ_SEMAN)**: Authorized values from codelists 3. **Coherence (REJ_COH)**: Data consistency (totals = sum of breakdowns) 4. **Period (REJ_PER)**: Transaction dates within declared period **Validated codes:** - SchemeID (ISO 6523): 0002=SIREN, 0009=SIRET, 0224=RoutingCode, etc. - RoleCode (UNCL 3035): SE=Seller, BY=Buyer, WK=Working party - CategoryCode (TT-81): TLB1, TPS1, TNT1, TMA1 - TaxCategoryCode (UNTDID 5305): S, Z, E, AE, K, G, O - Currency (ISO 4217), Country (ISO 3166-1) Returns structured validation errors with PPF rejection codes.
|
|
713
|
-
# @param xml_file [
|
|
713
|
+
# @param xml_file [String] E-reporting XML file to validate
|
|
714
714
|
# @param [Hash] opts the optional parameters
|
|
715
715
|
# @option opts [Boolean] :validate_coherence Validate data coherence (REJ_COH) (default to true)
|
|
716
716
|
# @option opts [Boolean] :validate_period Validate period coherence (REJ_PER) (default to true)
|
|
@@ -722,7 +722,7 @@ module FactPulse
|
|
|
722
722
|
|
|
723
723
|
# Validate e-reporting XML (PPF Annexe 6 v1.9 compliant)
|
|
724
724
|
# Validates an e-reporting XML file against PPF specifications (Annexe 6 v1.9): **Validation levels:** 1. **XSD (REJ_SEMAN)**: Structure, types, cardinality 2. **Semantic (REJ_SEMAN)**: Authorized values from codelists 3. **Coherence (REJ_COH)**: Data consistency (totals = sum of breakdowns) 4. **Period (REJ_PER)**: Transaction dates within declared period **Validated codes:** - SchemeID (ISO 6523): 0002=SIREN, 0009=SIRET, 0224=RoutingCode, etc. - RoleCode (UNCL 3035): SE=Seller, BY=Buyer, WK=Working party - CategoryCode (TT-81): TLB1, TPS1, TNT1, TMA1 - TaxCategoryCode (UNTDID 5305): S, Z, E, AE, K, G, O - Currency (ISO 4217), Country (ISO 3166-1) Returns structured validation errors with PPF rejection codes.
|
|
725
|
-
# @param xml_file [
|
|
725
|
+
# @param xml_file [String] E-reporting XML file to validate
|
|
726
726
|
# @param [Hash] opts the optional parameters
|
|
727
727
|
# @option opts [Boolean] :validate_coherence Validate data coherence (REJ_COH) (default to true)
|
|
728
728
|
# @option opts [Boolean] :validate_period Validate period coherence (REJ_PER) (default to true)
|
|
@@ -145,9 +145,11 @@ module FactPulse
|
|
|
145
145
|
end
|
|
146
146
|
|
|
147
147
|
# [Simplified] Get lifecycle events for invoices
|
|
148
|
-
# Returns lifecycle events (CDAR) grouped by invoice reference. **How it works (AFNOR XP Z12-013 compliant):** 1. Searches lifecycle flows on the PDP by flowType + flowDirection + date range 2. Downloads and parses each CDAR XML to extract the invoice reference 3. Groups events by invoice, sorted chronologically **Parameters:** - `days`: Number of days to look back (default: 7) - `invoiceId`: Optional filter on a specific invoice reference - `flowDirection`: `All` (default), `In` (statuses received from the counterparty) or `Out` (statuses issued by you or your PA, e.g. 202/203) **Authentication:** JWT Bearer (recommended) or PDP credentials as query parameters.
|
|
148
|
+
# Returns lifecycle events (CDAR) grouped by invoice reference. **How it works (AFNOR XP Z12-013 compliant):** 1. Searches lifecycle flows on the PDP by flowType + flowDirection + date range, following the cursor pagination (all pages are read) 2. Downloads and parses each CDAR XML to extract the invoice reference 3. Groups events by invoice, sorted chronologically **Parameters:** - `days`: Number of days to look back (default: 7). Ignored when `dateFrom` is set. - `dateFrom` / `dateTo`: Explicit time window (ISO 8601, UTC if no offset). `dateTo` defaults to now. - `invoiceId`: Optional filter on a specific invoice reference. The filter is applied after reading the window: prefer one call per synchronisation over one call per invoice. **Limits:** at most 1000 status flows are read per call. When the limit is reached, `truncated` is `true` and the response is incomplete: split the window with `dateFrom` / `dateTo`. For incremental synchronisation, request the period since your last successful sync (plus a small margin). - `flowDirection`: `All` (default), `In` (statuses received from the counterparty) or `Out` (statuses issued by you or your PA, e.g. 202/203) **Authentication:** JWT Bearer (recommended) or PDP credentials as query parameters.
|
|
149
149
|
# @param [Hash] opts the optional parameters
|
|
150
150
|
# @option opts [Integer] :days Number of days to look back (default to 7)
|
|
151
|
+
# @option opts [Time] :date_from Window start (ISO 8601, UTC if no offset). Overrides days.
|
|
152
|
+
# @option opts [Time] :date_to Window end (ISO 8601, UTC if no offset). Default: now
|
|
151
153
|
# @option opts [String] :invoice_id Filter by invoice reference
|
|
152
154
|
# @option opts [String] :flow_direction All (default), In (received statuses) or Out (issued statuses) (default to 'All')
|
|
153
155
|
# @option opts [String] :pdp_flow_service_url PDP Flow Service URL
|
|
@@ -162,9 +164,11 @@ module FactPulse
|
|
|
162
164
|
end
|
|
163
165
|
|
|
164
166
|
# [Simplified] Get lifecycle events for invoices
|
|
165
|
-
# Returns lifecycle events (CDAR) grouped by invoice reference. **How it works (AFNOR XP Z12-013 compliant):** 1. Searches lifecycle flows on the PDP by flowType + flowDirection + date range 2. Downloads and parses each CDAR XML to extract the invoice reference 3. Groups events by invoice, sorted chronologically **Parameters:** - `days`: Number of days to look back (default: 7) - `invoiceId`: Optional filter on a specific invoice reference - `flowDirection`: `All` (default), `In` (statuses received from the counterparty) or `Out` (statuses issued by you or your PA, e.g. 202/203) **Authentication:** JWT Bearer (recommended) or PDP credentials as query parameters.
|
|
167
|
+
# Returns lifecycle events (CDAR) grouped by invoice reference. **How it works (AFNOR XP Z12-013 compliant):** 1. Searches lifecycle flows on the PDP by flowType + flowDirection + date range, following the cursor pagination (all pages are read) 2. Downloads and parses each CDAR XML to extract the invoice reference 3. Groups events by invoice, sorted chronologically **Parameters:** - `days`: Number of days to look back (default: 7). Ignored when `dateFrom` is set. - `dateFrom` / `dateTo`: Explicit time window (ISO 8601, UTC if no offset). `dateTo` defaults to now. - `invoiceId`: Optional filter on a specific invoice reference. The filter is applied after reading the window: prefer one call per synchronisation over one call per invoice. **Limits:** at most 1000 status flows are read per call. When the limit is reached, `truncated` is `true` and the response is incomplete: split the window with `dateFrom` / `dateTo`. For incremental synchronisation, request the period since your last successful sync (plus a small margin). - `flowDirection`: `All` (default), `In` (statuses received from the counterparty) or `Out` (statuses issued by you or your PA, e.g. 202/203) **Authentication:** JWT Bearer (recommended) or PDP credentials as query parameters.
|
|
166
168
|
# @param [Hash] opts the optional parameters
|
|
167
169
|
# @option opts [Integer] :days Number of days to look back (default to 7)
|
|
170
|
+
# @option opts [Time] :date_from Window start (ISO 8601, UTC if no offset). Overrides days.
|
|
171
|
+
# @option opts [Time] :date_to Window end (ISO 8601, UTC if no offset). Default: now
|
|
168
172
|
# @option opts [String] :invoice_id Filter by invoice reference
|
|
169
173
|
# @option opts [String] :flow_direction All (default), In (received statuses) or Out (issued statuses) (default to 'All')
|
|
170
174
|
# @option opts [String] :pdp_flow_service_url PDP Flow Service URL
|
|
@@ -195,6 +199,8 @@ module FactPulse
|
|
|
195
199
|
# query parameters
|
|
196
200
|
query_params = opts[:query_params] || {}
|
|
197
201
|
query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil?
|
|
202
|
+
query_params[:'dateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil?
|
|
203
|
+
query_params[:'dateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil?
|
|
198
204
|
query_params[:'invoiceId'] = opts[:'invoice_id'] if !opts[:'invoice_id'].nil?
|
|
199
205
|
query_params[:'flowDirection'] = opts[:'flow_direction'] if !opts[:'flow_direction'].nil?
|
|
200
206
|
query_params[:'pdpFlowServiceUrl'] = opts[:'pdp_flow_service_url'] if !opts[:'pdp_flow_service_url'].nil?
|
|
@@ -705,7 +711,7 @@ module FactPulse
|
|
|
705
711
|
|
|
706
712
|
# Validate CDAR XML against XSD and Schematron BR-FR-CDV
|
|
707
713
|
# Validates a CDAR XML file against: 1. **XSD schema**: UN/CEFACT D22B CrossDomainAcknowledgementAndResponse 2. **Schematron BR-FR-CDV**: French business rules for invoice lifecycle Returns validation status and detailed error messages if invalid. **Note:** Use `/validate` to validate structured data fields (JSON).
|
|
708
|
-
# @param xml_file [
|
|
714
|
+
# @param xml_file [String] CDAR XML file to validate
|
|
709
715
|
# @param [Hash] opts the optional parameters
|
|
710
716
|
# @return [Hash<String, Object>]
|
|
711
717
|
def validate_xml_cdar_api_v1_cdar_validate_xml_post(xml_file, opts = {})
|
|
@@ -715,7 +721,7 @@ module FactPulse
|
|
|
715
721
|
|
|
716
722
|
# Validate CDAR XML against XSD and Schematron BR-FR-CDV
|
|
717
723
|
# Validates a CDAR XML file against: 1. **XSD schema**: UN/CEFACT D22B CrossDomainAcknowledgementAndResponse 2. **Schematron BR-FR-CDV**: French business rules for invoice lifecycle Returns validation status and detailed error messages if invalid. **Note:** Use `/validate` to validate structured data fields (JSON).
|
|
718
|
-
# @param xml_file [
|
|
724
|
+
# @param xml_file [String] CDAR XML file to validate
|
|
719
725
|
# @param [Hash] opts the optional parameters
|
|
720
726
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
721
727
|
def validate_xml_cdar_api_v1_cdar_validate_xml_post_with_http_info(xml_file, opts = {})
|
|
@@ -26,7 +26,7 @@ module FactPulse
|
|
|
26
26
|
# @option opts [APIProfile] :profile Factur-X/CII profile: MINIMUM, BASIC, EN16931 or EXTENDED. Ignored when output_format='ubl' (always EN16931).
|
|
27
27
|
# @option opts [OutputFormat] :output_format Output format: 'xml' or 'cii' (CII/Factur-X XML), 'ubl' (UBL 2.1 XML), 'pdf' (Factur-X PDF/A-3).
|
|
28
28
|
# @option opts [Boolean] :auto_enrich 🆕 Enable auto-enrichment from SIRET/SIREN (simplified format only) (default to true)
|
|
29
|
-
# @option opts [
|
|
29
|
+
# @option opts [String] :source_pdf
|
|
30
30
|
# @option opts [String] :callback_url
|
|
31
31
|
# @option opts [String] :webhook_mode Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL) (default to 'inline')
|
|
32
32
|
# @option opts [Boolean] :skip_br_fr
|
|
@@ -43,7 +43,7 @@ module FactPulse
|
|
|
43
43
|
# @option opts [APIProfile] :profile Factur-X/CII profile: MINIMUM, BASIC, EN16931 or EXTENDED. Ignored when output_format='ubl' (always EN16931).
|
|
44
44
|
# @option opts [OutputFormat] :output_format Output format: 'xml' or 'cii' (CII/Factur-X XML), 'ubl' (UBL 2.1 XML), 'pdf' (Factur-X PDF/A-3).
|
|
45
45
|
# @option opts [Boolean] :auto_enrich 🆕 Enable auto-enrichment from SIRET/SIREN (simplified format only) (default to true)
|
|
46
|
-
# @option opts [
|
|
46
|
+
# @option opts [String] :source_pdf
|
|
47
47
|
# @option opts [String] :callback_url
|
|
48
48
|
# @option opts [String] :webhook_mode Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL) (default to 'inline')
|
|
49
49
|
# @option opts [Boolean] :skip_br_fr
|
|
@@ -21,7 +21,7 @@ module FactPulse
|
|
|
21
21
|
end
|
|
22
22
|
# Parse Factur-X XML or PDF (async)
|
|
23
23
|
# Parse a Factur-X file asynchronously using a Celery task. **Use case:** For large files or when you want non-blocking processing. **Workflow:** 1. Submit file with this endpoint -> receive `task_id` 2. Poll `/tasks/{task_id}/status` for result 3. Result contains `invoice` and `detected_profile` **Optional:** Provide `callback_url` to receive a webhook when parsing completes.
|
|
24
|
-
# @param file [
|
|
24
|
+
# @param file [String] Factur-X PDF or XML file to parse
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
|
26
26
|
# @option opts [String] :callback_url
|
|
27
27
|
# @return [TaskResponse]
|
|
@@ -32,7 +32,7 @@ module FactPulse
|
|
|
32
32
|
|
|
33
33
|
# Parse Factur-X XML or PDF (async)
|
|
34
34
|
# Parse a Factur-X file asynchronously using a Celery task. **Use case:** For large files or when you want non-blocking processing. **Workflow:** 1. Submit file with this endpoint -> receive `task_id` 2. Poll `/tasks/{task_id}/status` for result 3. Result contains `invoice` and `detected_profile` **Optional:** Provide `callback_url` to receive a webhook when parsing completes.
|
|
35
|
-
# @param file [
|
|
35
|
+
# @param file [String] Factur-X PDF or XML file to parse
|
|
36
36
|
# @param [Hash] opts the optional parameters
|
|
37
37
|
# @option opts [String] :callback_url
|
|
38
38
|
# @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
|
|
@@ -93,7 +93,7 @@ module FactPulse
|
|
|
93
93
|
|
|
94
94
|
# Parse CII, UBL or Factur-X PDF (sync)
|
|
95
95
|
# Parse a CII XML, UBL XML, or Factur-X PDF and extract the invoice data as a FacturXInvoice model. **Use cases:** - Extract invoice data from received invoices (any format) - Round-trip: parse an existing invoice, modify it, and regenerate in another format - Convert between CII and UBL via the FacturXInvoice pivot model **Supported formats:** - Factur-X PDF (PDF/A-3 with embedded CII XML) - CII XML (UN/CEFACT Cross-Industry Invoice) - UBL 2.1 XML (OASIS Invoice or CreditNote) **Returns:** - `invoice`: Complete FacturXInvoice data (can be used with /generate-invoice) - `detected_profile`: Factur-X profile (MINIMUM, BASIC, EN16931, EXTENDED)
|
|
96
|
-
# @param file [
|
|
96
|
+
# @param file [String] Factur-X PDF or XML file to parse
|
|
97
97
|
# @param [Hash] opts the optional parameters
|
|
98
98
|
# @return [ParseFacturXResponse]
|
|
99
99
|
def parse_facturx_sync_api_v1_processing_parse_facturx_post(file, opts = {})
|
|
@@ -103,7 +103,7 @@ module FactPulse
|
|
|
103
103
|
|
|
104
104
|
# Parse CII, UBL or Factur-X PDF (sync)
|
|
105
105
|
# Parse a CII XML, UBL XML, or Factur-X PDF and extract the invoice data as a FacturXInvoice model. **Use cases:** - Extract invoice data from received invoices (any format) - Round-trip: parse an existing invoice, modify it, and regenerate in another format - Convert between CII and UBL via the FacturXInvoice pivot model **Supported formats:** - Factur-X PDF (PDF/A-3 with embedded CII XML) - CII XML (UN/CEFACT Cross-Industry Invoice) - UBL 2.1 XML (OASIS Invoice or CreditNote) **Returns:** - `invoice`: Complete FacturXInvoice data (can be used with /generate-invoice) - `detected_profile`: Factur-X profile (MINIMUM, BASIC, EN16931, EXTENDED)
|
|
106
|
-
# @param file [
|
|
106
|
+
# @param file [String] Factur-X PDF or XML file to parse
|
|
107
107
|
# @param [Hash] opts the optional parameters
|
|
108
108
|
# @return [Array<(ParseFacturXResponse, Integer, Hash)>] ParseFacturXResponse data, response status code and response headers
|
|
109
109
|
def parse_facturx_sync_api_v1_processing_parse_facturx_post_with_http_info(file, opts = {})
|
|
@@ -20,8 +20,8 @@ module FactPulse
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# Validate a CII or UBL XML against Schematron rules
|
|
23
|
-
# Validates a CII (Factur-X) or UBL XML file against Schematron business rules. The XML format is **auto-detected** from namespace: - CII XML → validated with EN16931-CII + profile-specific + BR-FR-CII Schematrons - UBL XML → validated with EN16931-UBL + BR-FR-UBL Schematrons ## Applied Standard **Schematron ISO/IEC 19757-3**: Business rules validation language for XML - Semantic validation (beyond XSD syntax) - European EN 16931 business rules - French-specific rules (BR-FR-CII or BR-FR-UBL) - Arithmetic calculations and data consistency ## Profiles and validated rules (CII only) ### MINIMUM (45 rules) - Unique invoice identifier - Dates (issue, due date) - Party identifiers (SIRET/SIREN) - Total gross amount ### BASIC (102 rules) - All MINIMUM rules - Detailed invoice lines - Basic VAT calculations - Payment methods - References (order, contract) ### EN16931 (178 rules) - All BASIC rules - **European rules (BR-xx)**: 81 business rules - **French rules (FR-xx)**: 12 France-specific rules - **Advanced calculations (CR-xx)**: 32 calculation rules - **Standardized codes (CL-xx)**: 52 code lists ### EXTENDED (210+ rules) - All EN16931 rules - Logistics information - Advanced accounting data - Multiple external references ## Checks performed ### 1. Syntax validation - Correct XML parsing (UTF-8, well-formed) - UN/CEFACT namespaces present - Hierarchical structure respected ### 2. Business rules (BR-xx) Examples: - `BR-1`: Invoice total must equal sum of line totals + document-level amounts - `BR-CO-10`: Sum of VAT base amounts must equal invoice net total - `BR-16`: Invoice currency code must be in ISO 4217 list ### 3. French rules (FR-xx) Examples: - `FR-1`: Supplier SIRET must have 14 digits - `FR-2`: Customer SIRET must have 14 digits (if present) - `FR-5`: Intra-EU VAT number must be in format FRxx999999999 ### 4. Calculation rules (CR-xx) - Net + VAT = Gross amounts - Sum of lines = Document total - Discounts and surcharges correctly applied - Compliant rounding (2 decimals for amounts) ### 5. Standardized codes (CL-xx) - ISO 3166-1 alpha-2 country codes - ISO 4217 currency codes - UN/ECE Rec 20 measurement units - VAT codes (types, categories, exemptions) - SchemeID for identifiers (0002=SIREN, 0009=SIRET, etc.) ## Validation process 1. **XSLT loading**: Schematron file converted to XSLT (Saxon-HE) 2. **Transformation**: Rules applied to XML 3. **Results analysis**: Extraction of
|
|
24
|
-
# @param xml_file [
|
|
23
|
+
# Validates a CII (Factur-X) or UBL XML file against Schematron business rules. The XML format is **auto-detected** from namespace: - CII XML → validated with EN16931-CII + profile-specific + BR-FR-CII Schematrons - UBL XML → validated with EN16931-UBL + BR-FR-UBL Schematrons ## Applied Standard **Schematron ISO/IEC 19757-3**: Business rules validation language for XML - Semantic validation (beyond XSD syntax) - European EN 16931 business rules - French-specific rules (BR-FR-CII or BR-FR-UBL) - Arithmetic calculations and data consistency ## Profiles and validated rules (CII only) ### MINIMUM (45 rules) - Unique invoice identifier - Dates (issue, due date) - Party identifiers (SIRET/SIREN) - Total gross amount ### BASIC (102 rules) - All MINIMUM rules - Detailed invoice lines - Basic VAT calculations - Payment methods - References (order, contract) ### EN16931 (178 rules) - All BASIC rules - **European rules (BR-xx)**: 81 business rules - **French rules (FR-xx)**: 12 France-specific rules - **Advanced calculations (CR-xx)**: 32 calculation rules - **Standardized codes (CL-xx)**: 52 code lists ### EXTENDED (210+ rules) - All EN16931 rules - Logistics information - Advanced accounting data - Multiple external references ## Checks performed ### 1. Syntax validation - Correct XML parsing (UTF-8, well-formed) - UN/CEFACT namespaces present - Hierarchical structure respected ### 2. Business rules (BR-xx) Examples: - `BR-1`: Invoice total must equal sum of line totals + document-level amounts - `BR-CO-10`: Sum of VAT base amounts must equal invoice net total - `BR-16`: Invoice currency code must be in ISO 4217 list ### 3. French rules (FR-xx) Examples: - `FR-1`: Supplier SIRET must have 14 digits - `FR-2`: Customer SIRET must have 14 digits (if present) - `FR-5`: Intra-EU VAT number must be in format FRxx999999999 ### 4. Calculation rules (CR-xx) - Net + VAT = Gross amounts - Sum of lines = Document total - Discounts and surcharges correctly applied - Compliant rounding (2 decimals for amounts) ### 5. Standardized codes (CL-xx) - ISO 3166-1 alpha-2 country codes - ISO 4217 currency codes - UN/ECE Rec 20 measurement units - VAT codes (types, categories, exemptions) - SchemeID for identifiers (0002=SIREN, 0009=SIRET, etc.) ## Validation process 1. **XSLT loading**: Schematron file converted to XSLT (Saxon-HE) 2. **Transformation**: Rules applied to XML 3. **Results analysis**: Extraction of `failed-assert` and `successful-report`; an unflagged rule is fatal, flagged `warning`/`info` rules are non-blocking 4. **Report**: Structured list of non-conformities ## Responses **200 OK**: Compliant XML ```json { \"message\": \"XML is compliant with EN16931 profile\" } ``` **400 Bad Request**: Non-compliant XML ```json { \"detail\": [ \"[BR-1] Invoice total (120.00) does not match calculated sum (100.00 + 20.00)\", \"[FR-1] Supplier SIRET must contain exactly 14 digits\" ] } ``` ## Use cases - **Pre-validation**: Verify XML before PDF/A integration - **Debugging**: Precisely identify generation errors - **Testing**: Validate test or example XMLs - **Compliance**: Ensure European and French rules are met - **Development**: Quick testing without PDF generation ## Processing time - MINIMUM profile: ~0.5 second - EN16931 profile: ~1-2 seconds - EXTENDED profile: ~2-3 seconds
|
|
24
|
+
# @param xml_file [String] CII (Factur-X) or UBL XML file to validate (.xml format). Format is auto-detected.
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
|
26
26
|
# @option opts [APIProfile] :profile Validation profile (MINIMUM, BASIC, EN16931, EXTENDED). Used for CII only; ignored for UBL (always EN16931).
|
|
27
27
|
# @option opts [Boolean] :skip_br_fr
|
|
@@ -32,8 +32,8 @@ module FactPulse
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
# Validate a CII or UBL XML against Schematron rules
|
|
35
|
-
# Validates a CII (Factur-X) or UBL XML file against Schematron business rules. The XML format is **auto-detected** from namespace: - CII XML → validated with EN16931-CII + profile-specific + BR-FR-CII Schematrons - UBL XML → validated with EN16931-UBL + BR-FR-UBL Schematrons ## Applied Standard **Schematron ISO/IEC 19757-3**: Business rules validation language for XML - Semantic validation (beyond XSD syntax) - European EN 16931 business rules - French-specific rules (BR-FR-CII or BR-FR-UBL) - Arithmetic calculations and data consistency ## Profiles and validated rules (CII only) ### MINIMUM (45 rules) - Unique invoice identifier - Dates (issue, due date) - Party identifiers (SIRET/SIREN) - Total gross amount ### BASIC (102 rules) - All MINIMUM rules - Detailed invoice lines - Basic VAT calculations - Payment methods - References (order, contract) ### EN16931 (178 rules) - All BASIC rules - **European rules (BR-xx)**: 81 business rules - **French rules (FR-xx)**: 12 France-specific rules - **Advanced calculations (CR-xx)**: 32 calculation rules - **Standardized codes (CL-xx)**: 52 code lists ### EXTENDED (210+ rules) - All EN16931 rules - Logistics information - Advanced accounting data - Multiple external references ## Checks performed ### 1. Syntax validation - Correct XML parsing (UTF-8, well-formed) - UN/CEFACT namespaces present - Hierarchical structure respected ### 2. Business rules (BR-xx) Examples: - `BR-1`: Invoice total must equal sum of line totals + document-level amounts - `BR-CO-10`: Sum of VAT base amounts must equal invoice net total - `BR-16`: Invoice currency code must be in ISO 4217 list ### 3. French rules (FR-xx) Examples: - `FR-1`: Supplier SIRET must have 14 digits - `FR-2`: Customer SIRET must have 14 digits (if present) - `FR-5`: Intra-EU VAT number must be in format FRxx999999999 ### 4. Calculation rules (CR-xx) - Net + VAT = Gross amounts - Sum of lines = Document total - Discounts and surcharges correctly applied - Compliant rounding (2 decimals for amounts) ### 5. Standardized codes (CL-xx) - ISO 3166-1 alpha-2 country codes - ISO 4217 currency codes - UN/ECE Rec 20 measurement units - VAT codes (types, categories, exemptions) - SchemeID for identifiers (0002=SIREN, 0009=SIRET, etc.) ## Validation process 1. **XSLT loading**: Schematron file converted to XSLT (Saxon-HE) 2. **Transformation**: Rules applied to XML 3. **Results analysis**: Extraction of
|
|
36
|
-
# @param xml_file [
|
|
35
|
+
# Validates a CII (Factur-X) or UBL XML file against Schematron business rules. The XML format is **auto-detected** from namespace: - CII XML → validated with EN16931-CII + profile-specific + BR-FR-CII Schematrons - UBL XML → validated with EN16931-UBL + BR-FR-UBL Schematrons ## Applied Standard **Schematron ISO/IEC 19757-3**: Business rules validation language for XML - Semantic validation (beyond XSD syntax) - European EN 16931 business rules - French-specific rules (BR-FR-CII or BR-FR-UBL) - Arithmetic calculations and data consistency ## Profiles and validated rules (CII only) ### MINIMUM (45 rules) - Unique invoice identifier - Dates (issue, due date) - Party identifiers (SIRET/SIREN) - Total gross amount ### BASIC (102 rules) - All MINIMUM rules - Detailed invoice lines - Basic VAT calculations - Payment methods - References (order, contract) ### EN16931 (178 rules) - All BASIC rules - **European rules (BR-xx)**: 81 business rules - **French rules (FR-xx)**: 12 France-specific rules - **Advanced calculations (CR-xx)**: 32 calculation rules - **Standardized codes (CL-xx)**: 52 code lists ### EXTENDED (210+ rules) - All EN16931 rules - Logistics information - Advanced accounting data - Multiple external references ## Checks performed ### 1. Syntax validation - Correct XML parsing (UTF-8, well-formed) - UN/CEFACT namespaces present - Hierarchical structure respected ### 2. Business rules (BR-xx) Examples: - `BR-1`: Invoice total must equal sum of line totals + document-level amounts - `BR-CO-10`: Sum of VAT base amounts must equal invoice net total - `BR-16`: Invoice currency code must be in ISO 4217 list ### 3. French rules (FR-xx) Examples: - `FR-1`: Supplier SIRET must have 14 digits - `FR-2`: Customer SIRET must have 14 digits (if present) - `FR-5`: Intra-EU VAT number must be in format FRxx999999999 ### 4. Calculation rules (CR-xx) - Net + VAT = Gross amounts - Sum of lines = Document total - Discounts and surcharges correctly applied - Compliant rounding (2 decimals for amounts) ### 5. Standardized codes (CL-xx) - ISO 3166-1 alpha-2 country codes - ISO 4217 currency codes - UN/ECE Rec 20 measurement units - VAT codes (types, categories, exemptions) - SchemeID for identifiers (0002=SIREN, 0009=SIRET, etc.) ## Validation process 1. **XSLT loading**: Schematron file converted to XSLT (Saxon-HE) 2. **Transformation**: Rules applied to XML 3. **Results analysis**: Extraction of `failed-assert` and `successful-report`; an unflagged rule is fatal, flagged `warning`/`info` rules are non-blocking 4. **Report**: Structured list of non-conformities ## Responses **200 OK**: Compliant XML ```json { \"message\": \"XML is compliant with EN16931 profile\" } ``` **400 Bad Request**: Non-compliant XML ```json { \"detail\": [ \"[BR-1] Invoice total (120.00) does not match calculated sum (100.00 + 20.00)\", \"[FR-1] Supplier SIRET must contain exactly 14 digits\" ] } ``` ## Use cases - **Pre-validation**: Verify XML before PDF/A integration - **Debugging**: Precisely identify generation errors - **Testing**: Validate test or example XMLs - **Compliance**: Ensure European and French rules are met - **Development**: Quick testing without PDF generation ## Processing time - MINIMUM profile: ~0.5 second - EN16931 profile: ~1-2 seconds - EXTENDED profile: ~2-3 seconds
|
|
36
|
+
# @param xml_file [String] CII (Factur-X) or UBL XML file to validate (.xml format). Format is auto-detected.
|
|
37
37
|
# @param [Hash] opts the optional parameters
|
|
38
38
|
# @option opts [APIProfile] :profile Validation profile (MINIMUM, BASIC, EN16931, EXTENDED). Used for CII only; ignored for UBL (always EN16931).
|
|
39
39
|
# @option opts [Boolean] :skip_br_fr
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
|
-
# Montant encaissé en EUR (
|
|
17
|
+
# Montant TTC encaissé pour ce taux, en EUR (MDT-215). Négatif pour un décaissement (remboursement, P1.15)
|
|
18
18
|
module Amount1
|
|
19
19
|
class << self
|
|
20
20
|
# List of class defined in anyOf (OpenAPI v3)
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
|
-
#
|
|
17
|
+
# Montant TTC encaissé en EUR, à un seul taux (vatRate). Négatif pour un décaissement (remboursement). Pour plusieurs taux, utiliser amountsByRate. Requis si amountsByRate est absent (BR-FR-CDV-14)
|
|
18
18
|
module Amount2
|
|
19
19
|
class << self
|
|
20
20
|
# List of class defined in anyOf (OpenAPI v3)
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#FactPulse REST API
|
|
3
|
+
|
|
4
|
+
# REST API for electronic invoicing in France: Factur-X (CII), UBL 2.1, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Invoice Generation - **Formats**: CII XML, UBL 2.1 XML, or Factur-X PDF/A-3 - **Profiles** (CII/PDF): MINIMUM, BASIC, EN16931, EXTENDED - **UBL**: Always EN16931 compliant - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT), UBL 2.1 (OASIS) - **Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Factur-X - Validation - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) ### ✍️ Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification ### 📋 Flux 6 - Invoice Lifecycle (CDAR) - **CDAR Messages**: Acknowledgements, invoice statuses - **PPF Statuses**: REFUSED (210), PAID (212) ### 📊 Flux 10 - E-Reporting - **Tax Declarations**: International B2B, B2C - **Flow Types**: 10.1 (B2B transactions), 10.2 (B2B payments), 10.3 (B2C transactions), 10.4 (B2C payments) ### 📡 AFNOR PDP/PA (XP Z12-013) - **Flow Service**: Submit and search flows to PDPs - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user ### 🏛️ Chorus Pro - **Public Sector Invoicing**: Complete API for Chorus Pro ### ⏳ Async Tasks - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **Webhooks**: Automatic notifications when tasks complete ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: contact@factpulse.fr
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.21.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module FactPulse
|
|
17
|
+
# Collected amount for this VAT rate (TT-95 / TT-99). Negative for a refund, on the refund date (G7.07)
|
|
18
|
+
module Amount3
|
|
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
|
|
@@ -65,6 +65,10 @@ module FactPulse
|
|
|
65
65
|
# Taux de TVA du montant encaissé en % (MDT-224, requis par BR-FR-CDV-14 pour le statut 212 ; défaut 20)
|
|
66
66
|
attr_accessor :encaisse_vat_rate
|
|
67
67
|
|
|
68
|
+
attr_accessor :encaisse_amounts_by_rate
|
|
69
|
+
|
|
70
|
+
attr_accessor :comment
|
|
71
|
+
|
|
68
72
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
69
73
|
def self.attribute_map
|
|
70
74
|
{
|
|
@@ -86,7 +90,9 @@ module FactPulse
|
|
|
86
90
|
:'reason_text' => :'reasonText',
|
|
87
91
|
:'action_code' => :'actionCode',
|
|
88
92
|
:'encaisse_amount' => :'encaisseAmount',
|
|
89
|
-
:'encaisse_vat_rate' => :'encaisseVatRate'
|
|
93
|
+
:'encaisse_vat_rate' => :'encaisseVatRate',
|
|
94
|
+
:'encaisse_amounts_by_rate' => :'encaisseAmountsByRate',
|
|
95
|
+
:'comment' => :'comment'
|
|
90
96
|
}
|
|
91
97
|
end
|
|
92
98
|
|
|
@@ -121,7 +127,9 @@ module FactPulse
|
|
|
121
127
|
:'reason_text' => :'String',
|
|
122
128
|
:'action_code' => :'String',
|
|
123
129
|
:'encaisse_amount' => :'Encaisseamount',
|
|
124
|
-
:'encaisse_vat_rate' => :'Float'
|
|
130
|
+
:'encaisse_vat_rate' => :'Float',
|
|
131
|
+
:'encaisse_amounts_by_rate' => :'Array<EncaisseAmountByRate>',
|
|
132
|
+
:'comment' => :'String'
|
|
125
133
|
}
|
|
126
134
|
end
|
|
127
135
|
|
|
@@ -136,6 +144,8 @@ module FactPulse
|
|
|
136
144
|
:'reason_text',
|
|
137
145
|
:'action_code',
|
|
138
146
|
:'encaisse_amount',
|
|
147
|
+
:'encaisse_amounts_by_rate',
|
|
148
|
+
:'comment'
|
|
139
149
|
])
|
|
140
150
|
end
|
|
141
151
|
|
|
@@ -252,6 +262,16 @@ module FactPulse
|
|
|
252
262
|
else
|
|
253
263
|
self.encaisse_vat_rate = 20
|
|
254
264
|
end
|
|
265
|
+
|
|
266
|
+
if attributes.key?(:'encaisse_amounts_by_rate')
|
|
267
|
+
if (value = attributes[:'encaisse_amounts_by_rate']).is_a?(Array)
|
|
268
|
+
self.encaisse_amounts_by_rate = value
|
|
269
|
+
end
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
if attributes.key?(:'comment')
|
|
273
|
+
self.comment = attributes[:'comment']
|
|
274
|
+
end
|
|
255
275
|
end
|
|
256
276
|
|
|
257
277
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -279,6 +299,14 @@ module FactPulse
|
|
|
279
299
|
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
280
300
|
end
|
|
281
301
|
|
|
302
|
+
if !@encaisse_amounts_by_rate.nil? && @encaisse_amounts_by_rate.length < 1
|
|
303
|
+
invalid_properties.push('invalid value for "encaisse_amounts_by_rate", number of items must be greater than or equal to 1.')
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
if !@comment.nil? && @comment.to_s.length > 2000
|
|
307
|
+
invalid_properties.push('invalid value for "comment", the character length must be smaller than or equal to 2000.')
|
|
308
|
+
end
|
|
309
|
+
|
|
282
310
|
invalid_properties
|
|
283
311
|
end
|
|
284
312
|
|
|
@@ -291,6 +319,8 @@ module FactPulse
|
|
|
291
319
|
return false if @invoice_id.nil?
|
|
292
320
|
return false if @invoice_issue_date.nil?
|
|
293
321
|
return false if @status.nil?
|
|
322
|
+
return false if !@encaisse_amounts_by_rate.nil? && @encaisse_amounts_by_rate.length < 1
|
|
323
|
+
return false if !@comment.nil? && @comment.to_s.length > 2000
|
|
294
324
|
true
|
|
295
325
|
end
|
|
296
326
|
|
|
@@ -344,6 +374,26 @@ module FactPulse
|
|
|
344
374
|
@status = status
|
|
345
375
|
end
|
|
346
376
|
|
|
377
|
+
# Custom attribute writer method with validation
|
|
378
|
+
# @param [Object] encaisse_amounts_by_rate Value to be assigned
|
|
379
|
+
def encaisse_amounts_by_rate=(encaisse_amounts_by_rate)
|
|
380
|
+
if !encaisse_amounts_by_rate.nil? && encaisse_amounts_by_rate.length < 1
|
|
381
|
+
fail ArgumentError, 'invalid value for "encaisse_amounts_by_rate", number of items must be greater than or equal to 1.'
|
|
382
|
+
end
|
|
383
|
+
|
|
384
|
+
@encaisse_amounts_by_rate = encaisse_amounts_by_rate
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
# Custom attribute writer method with validation
|
|
388
|
+
# @param [Object] comment Value to be assigned
|
|
389
|
+
def comment=(comment)
|
|
390
|
+
if !comment.nil? && comment.to_s.length > 2000
|
|
391
|
+
fail ArgumentError, 'invalid value for "comment", the character length must be smaller than or equal to 2000.'
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
@comment = comment
|
|
395
|
+
end
|
|
396
|
+
|
|
347
397
|
# Checks equality by comparing each attribute.
|
|
348
398
|
# @param [Object] Object to be compared
|
|
349
399
|
def ==(o)
|
|
@@ -367,7 +417,9 @@ module FactPulse
|
|
|
367
417
|
reason_text == o.reason_text &&
|
|
368
418
|
action_code == o.action_code &&
|
|
369
419
|
encaisse_amount == o.encaisse_amount &&
|
|
370
|
-
encaisse_vat_rate == o.encaisse_vat_rate
|
|
420
|
+
encaisse_vat_rate == o.encaisse_vat_rate &&
|
|
421
|
+
encaisse_amounts_by_rate == o.encaisse_amounts_by_rate &&
|
|
422
|
+
comment == o.comment
|
|
371
423
|
end
|
|
372
424
|
|
|
373
425
|
# @see the `==` method
|
|
@@ -379,7 +431,7 @@ module FactPulse
|
|
|
379
431
|
# Calculates hash code according to all attributes.
|
|
380
432
|
# @return [Integer] Hash code
|
|
381
433
|
def hash
|
|
382
|
-
[document_id, business_process, type_code, sender_siren, sender_role, sender_name, sender_email, recipients, invoice_id, invoice_issue_date, invoice_type_code, invoice_seller_siren, invoice_buyer_siren, status, reason_code, reason_text, action_code, encaisse_amount, encaisse_vat_rate].hash
|
|
434
|
+
[document_id, business_process, type_code, sender_siren, sender_role, sender_name, sender_email, recipients, invoice_id, invoice_issue_date, invoice_type_code, invoice_seller_siren, invoice_buyer_siren, status, reason_code, reason_text, action_code, encaisse_amount, encaisse_vat_rate, encaisse_amounts_by_rate, comment].hash
|
|
383
435
|
end
|
|
384
436
|
|
|
385
437
|
# Builds the object from hash
|