factpulse 0.1.0 → 1.0.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 +15 -4
- data/Gemfile.lock +7 -7
- data/LICENSE +1 -1
- data/README.md +146 -159
- data/docs/AFNORPDPPAApi.md +6 -87
- data/docs/AFNORPDPPADirectoryServiceApi.md +238 -148
- data/docs/AFNORPDPPAFlowServiceApi.md +40 -52
- data/docs/APIError.md +2 -2
- data/docs/AdresseElectronique.md +20 -0
- data/docs/AdressePostale.md +26 -0
- data/docs/CadreDeFacturation.md +22 -0
- data/docs/CategorieTVA.md +15 -0
- data/docs/CertificateInfoResponse.md +20 -20
- data/docs/ChorusProApi.md +142 -224
- data/docs/ChorusProCredentials.md +5 -5
- data/docs/{AFNORDiffusionStatus.md → CodeCadreFacturation.md} +2 -2
- data/docs/{AFNORFacilityType.md → CodeRaisonReduction.md} +2 -2
- data/docs/{GetInvoiceRequest.md → ConsulterFactureRequest.md} +4 -4
- data/docs/ConsulterFactureResponse.md +34 -0
- data/docs/ConsulterStructureRequest.md +22 -0
- data/docs/ConsulterStructureResponse.md +34 -0
- data/docs/{AFNORCredentials.md → CredentialsAFNOR.md} +2 -2
- data/docs/{FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md → CredentialsChorusPro.md} +4 -4
- data/docs/Destinataire.md +28 -0
- data/docs/Destination.md +7 -7
- data/docs/DestinationAFNOR.md +24 -0
- data/docs/DestinationChorusPro.md +20 -0
- data/docs/DonneesFactureSimplifiees.md +34 -0
- data/docs/FactureEnrichieInfo.md +32 -0
- data/docs/FactureFacturX.md +46 -0
- data/docs/FormatSortie.md +15 -0
- data/docs/Fournisseur.md +36 -0
- data/docs/GenerateCertificateRequest.md +19 -19
- data/docs/GenerateCertificateResponse.md +8 -8
- data/docs/InformationSignatureAPI.md +28 -0
- data/docs/LigneDePoste.md +46 -0
- data/docs/LigneDePosteMontantRemiseHt.md +15 -0
- data/docs/LigneDePosteTauxTvaManuel.md +15 -0
- data/docs/LigneDeTVA.md +26 -0
- data/docs/{AmountDue.md → ModeDepot.md} +2 -2
- data/docs/ModePaiement.md +15 -0
- data/docs/{AFNORFlowType.md → MontantAPayer.md} +2 -2
- data/docs/MontantBaseHt.md +15 -0
- data/docs/{AFNORAlgorithm.md → MontantHtTotal.md} +2 -2
- data/docs/{AFNORContainsOperator.md → MontantRemiseGlobaleTtc.md} +2 -2
- data/docs/MontantTotal.md +30 -0
- data/docs/{AFNORFacilityNature.md → MontantTotalAcompte.md} +2 -2
- data/docs/MontantTotalLigneHt.md +15 -0
- data/docs/{AFNORFlowSyntax.md → MontantTtcTotal.md} +2 -2
- data/docs/{APIProfile.md → MontantTva.md} +2 -2
- data/docs/{AFNOREntityType.md → MontantTvaLigne.md} +2 -2
- data/docs/MontantTvaTotal.md +15 -0
- data/docs/{AFNORFlowProfile.md → MontantUnitaireHt.md} +2 -2
- data/docs/{InvoiceNote.md → Note.md} +3 -3
- data/docs/ObtenirIdChorusProRequest.md +22 -0
- data/docs/ObtenirIdChorusProResponse.md +24 -0
- data/docs/OptionsProcessing.md +24 -0
- data/docs/PDFFacturXInfo.md +22 -0
- data/docs/ParametresSignature.md +34 -0
- data/docs/ParametresStructure.md +22 -0
- data/docs/PieceJointeComplementaire.md +26 -0
- data/docs/{Amount.md → ProfilAPI.md} +2 -2
- data/docs/{Amount2.md → Quantite.md} +2 -2
- data/docs/RechercherServicesResponse.md +24 -0
- data/docs/RechercherStructureRequest.md +26 -0
- data/docs/RechercherStructureResponse.md +24 -0
- data/docs/References.md +32 -0
- data/docs/ReponseTache.md +18 -0
- data/docs/ReponseValidationErreur.md +18 -0
- data/docs/ReponseValidationSucces.md +18 -0
- data/docs/ResultatAFNOR.md +26 -0
- data/docs/ResultatChorusPro.md +22 -0
- data/docs/ResultatValidationPDFAPI.md +62 -0
- data/docs/SantApi.md +131 -0
- data/docs/ServiceStructure.md +24 -0
- data/docs/SignatureInfo.md +2 -2
- data/docs/SoumettreFactureCompleteRequest.md +26 -0
- data/docs/SoumettreFactureCompleteResponse.md +34 -0
- data/docs/SoumettreFactureRequest.md +46 -0
- data/docs/SoumettreFactureResponse.md +24 -0
- data/docs/StatutCelery.md +15 -0
- data/docs/{InvoiceStatus.md → StatutFacture.md} +5 -5
- data/docs/StatutTache.md +22 -0
- data/docs/StructureInfo.md +10 -10
- data/docs/Tauxmanuel.md +15 -0
- data/docs/TraitementFactureApi.md +831 -0
- data/docs/TypeFacture.md +15 -0
- data/docs/{Amount1.md → TypeTVA.md} +2 -2
- data/docs/{Rate.md → Unite.md} +2 -2
- data/docs/UtilisateurApi.md +74 -0
- data/docs/ValidationError.md +1 -1
- data/docs/ValidationErrorDetail.md +3 -3
- data/docs/{AFNORDirectoryLineField.md → ValidationErrorLocInner.md} +2 -2
- data/factpulse.gemspec +7 -7
- data/lib/factpulse/api/afnorpdppa_api.rb +8 -77
- data/lib/factpulse/api/afnorpdppa_directory_service_api.rb +143 -143
- data/lib/factpulse/api/afnorpdppa_flow_service_api.rb +34 -67
- data/lib/factpulse/api/chorus_pro_api.rb +147 -149
- data/lib/factpulse/api/sant_api.rb +136 -0
- data/lib/factpulse/api/traitement_facture_api.rb +835 -0
- data/lib/factpulse/api/utilisateur_api.rb +79 -0
- data/lib/factpulse/api_client.rb +4 -4
- data/lib/factpulse/api_error.rb +4 -4
- data/lib/factpulse/api_model_base.rb +4 -4
- data/lib/factpulse/configuration.rb +8 -19
- data/lib/factpulse/helpers/client.rb +246 -218
- data/lib/factpulse/helpers/exceptions.rb +14 -38
- data/lib/factpulse/helpers.rb +13 -0
- data/lib/factpulse/models/adresse_electronique.rb +196 -0
- data/lib/factpulse/models/adresse_postale.rb +189 -0
- data/lib/factpulse/models/api_error.rb +7 -7
- data/lib/factpulse/models/cadre_de_facturation.rb +207 -0
- data/lib/factpulse/models/categorie_tva.rb +47 -0
- data/lib/factpulse/models/certificate_info_response.rb +166 -166
- data/lib/factpulse/models/chorus_pro_credentials.rb +14 -14
- data/lib/factpulse/models/code_cadre_facturation.rb +42 -0
- data/lib/factpulse/models/code_raison_reduction.rb +45 -0
- data/lib/factpulse/models/consulter_facture_request.rb +176 -0
- data/lib/factpulse/models/consulter_facture_response.rb +261 -0
- data/lib/factpulse/models/consulter_structure_request.rb +188 -0
- data/lib/factpulse/models/consulter_structure_response.rb +261 -0
- data/lib/factpulse/models/credentials_afnor.rb +169 -0
- data/lib/factpulse/models/credentials_chorus_pro.rb +191 -0
- data/lib/factpulse/models/destinataire.rb +215 -0
- data/lib/factpulse/models/destination.rb +9 -9
- data/lib/factpulse/models/destination_afnor.rb +228 -0
- data/lib/factpulse/models/destination_chorus_pro.rb +194 -0
- data/lib/factpulse/models/donnees_facture_simplifiees.rb +342 -0
- data/lib/factpulse/models/error_level.rb +4 -4
- data/lib/factpulse/models/error_source.rb +5 -6
- data/lib/factpulse/models/facture_enrichie_info.rb +348 -0
- data/lib/factpulse/models/facture_factur_x.rb +443 -0
- data/lib/factpulse/models/format_sortie.rb +40 -0
- data/lib/factpulse/models/fournisseur.rb +271 -0
- data/lib/factpulse/models/generate_certificate_request.rb +108 -108
- data/lib/factpulse/models/generate_certificate_response.rb +49 -49
- data/lib/factpulse/models/http_validation_error.rb +4 -4
- data/lib/factpulse/models/information_signature_api.rb +216 -0
- data/lib/factpulse/models/ligne_de_poste.rb +390 -0
- data/lib/factpulse/models/ligne_de_poste_montant_remise_ht.rb +104 -0
- data/lib/factpulse/models/ligne_de_poste_taux_tva_manuel.rb +104 -0
- data/lib/factpulse/models/ligne_de_tva.rb +242 -0
- data/lib/factpulse/models/mode_depot.rb +41 -0
- data/lib/factpulse/models/mode_paiement.rb +44 -0
- data/lib/factpulse/models/montant_a_payer.rb +104 -0
- data/lib/factpulse/models/montant_base_ht.rb +104 -0
- data/lib/factpulse/models/montant_ht_total.rb +104 -0
- data/lib/factpulse/models/montant_remise_globale_ttc.rb +104 -0
- data/lib/factpulse/models/montant_total.rb +272 -0
- data/lib/factpulse/models/montant_total_acompte.rb +104 -0
- data/lib/factpulse/models/montant_total_ligne_ht.rb +104 -0
- data/lib/factpulse/models/montant_ttc_total.rb +104 -0
- data/lib/factpulse/models/montant_tva.rb +104 -0
- data/lib/factpulse/models/montant_tva_ligne.rb +104 -0
- data/lib/factpulse/models/montant_tva_total.rb +104 -0
- data/lib/factpulse/models/montant_unitaire_ht.rb +104 -0
- data/lib/factpulse/models/note.rb +175 -0
- data/lib/factpulse/models/obtenir_id_chorus_pro_request.rb +188 -0
- data/lib/factpulse/models/obtenir_id_chorus_pro_response.rb +230 -0
- data/lib/factpulse/models/options_processing.rb +207 -0
- data/lib/factpulse/models/parametres_signature.rb +235 -0
- data/lib/factpulse/models/parametres_structure.rb +175 -0
- data/lib/factpulse/models/pdf_factur_x_info.rb +205 -0
- data/lib/factpulse/models/piece_jointe_complementaire.rb +269 -0
- data/lib/factpulse/models/profil_api.rb +42 -0
- data/lib/factpulse/models/quantite.rb +104 -0
- data/lib/factpulse/models/rechercher_services_response.rb +214 -0
- data/lib/factpulse/models/rechercher_structure_request.rb +191 -0
- data/lib/factpulse/models/rechercher_structure_response.rb +216 -0
- data/lib/factpulse/models/references.rb +290 -0
- data/lib/factpulse/models/reponse_tache.rb +165 -0
- data/lib/factpulse/models/reponse_validation_erreur.rb +167 -0
- data/lib/factpulse/models/reponse_validation_succes.rb +165 -0
- data/lib/factpulse/models/resultat_afnor.rb +240 -0
- data/lib/factpulse/models/resultat_chorus_pro.rb +186 -0
- data/lib/factpulse/models/resultat_validation_pdfapi.rb +523 -0
- data/lib/factpulse/models/scheme_id.rb +7 -20
- data/lib/factpulse/models/service_structure.rb +247 -0
- data/lib/factpulse/models/signature_info.rb +22 -22
- data/lib/factpulse/models/soumettre_facture_complete_request.rb +239 -0
- data/lib/factpulse/models/soumettre_facture_complete_response.rb +355 -0
- data/lib/factpulse/models/soumettre_facture_request.rb +388 -0
- data/lib/factpulse/models/soumettre_facture_response.rb +213 -0
- data/lib/factpulse/models/statut_celery.rb +43 -0
- data/lib/factpulse/models/statut_facture.rb +203 -0
- data/lib/factpulse/models/statut_tache.rb +226 -0
- data/lib/factpulse/models/structure_info.rb +86 -86
- data/lib/factpulse/models/tauxmanuel.rb +104 -0
- data/lib/factpulse/models/type_facture.rb +40 -0
- data/lib/factpulse/models/type_tva.rb +42 -0
- data/lib/factpulse/models/unite.rb +44 -0
- data/lib/factpulse/models/validation_error.rb +5 -5
- data/lib/factpulse/models/validation_error_detail.rb +8 -8
- data/lib/factpulse/models/validation_error_loc_inner.rb +103 -0
- data/lib/factpulse/version.rb +5 -5
- data/lib/factpulse.rb +79 -315
- metadata +215 -676
- data/docs/AFNORAcknowledgement.md +0 -20
- data/docs/AFNORAcknowledgementDetail.md +0 -24
- data/docs/AFNORAddressEdit.md +0 -30
- data/docs/AFNORAddressPatch.md +0 -30
- data/docs/AFNORAddressPut.md +0 -30
- data/docs/AFNORAddressRead.md +0 -32
- data/docs/AFNORCreateDirectoryLineBody.md +0 -20
- data/docs/AFNORCreateDirectoryLineBodyAddressingInformation.md +0 -24
- data/docs/AFNORCreateDirectoryLineBodyPeriod.md +0 -20
- data/docs/AFNORCreateRoutingCodeBody.md +0 -32
- data/docs/AFNORDestination.md +0 -26
- data/docs/AFNORDirectoryLinePayloadHistoryLegalUnitFacilityRoutingCode.md +0 -32
- data/docs/AFNORDirectoryLinePayloadHistoryLegalUnitFacilityRoutingCodePlatform.md +0 -20
- data/docs/AFNORDirectoryLinePayloadHistoryLegalUnitFacilityRoutingCodeRoutingCode.md +0 -28
- data/docs/AFNORDirectoryLinePost201Response.md +0 -22
- data/docs/AFNORDirectoryLineSearchPost200Response.md +0 -22
- data/docs/AFNORError.md +0 -26
- data/docs/AFNORFacilityAdministrativeStatus.md +0 -15
- data/docs/AFNORFacilityPayloadHistory.md +0 -34
- data/docs/AFNORFacilityPayloadHistoryUleB2gAdditionalData.md +0 -28
- data/docs/AFNORFacilityPayloadIncluded.md +0 -32
- data/docs/AFNORFlow.md +0 -38
- data/docs/AFNORFlowAckStatus.md +0 -15
- data/docs/AFNORFlowDirection.md +0 -15
- data/docs/AFNORFlowInfo.md +0 -28
- data/docs/AFNORFullFlowInfo.md +0 -32
- data/docs/AFNORHealthCheckResponse.md +0 -22
- data/docs/AFNORLegalUnitAdministrativeStatus.md +0 -15
- data/docs/AFNORLegalUnitPayloadHistory.md +0 -24
- data/docs/AFNORLegalUnitPayloadIncluded.md +0 -24
- data/docs/AFNORLegalUnitPayloadIncludedNoSiren.md +0 -22
- data/docs/AFNORPlatformStatus.md +0 -15
- data/docs/AFNORProcessingRule.md +0 -15
- data/docs/AFNORReasonCode.md +0 -49
- data/docs/AFNORReasonCodeEnum.md +0 -15
- data/docs/AFNORRecipientPlatformType.md +0 -15
- data/docs/AFNORResult.md +0 -32
- data/docs/AFNORRoutingCodeAdministrativeStatus.md +0 -15
- data/docs/AFNORRoutingCodeField.md +0 -15
- data/docs/AFNORRoutingCodePayloadHistoryLegalUnitFacility.md +0 -34
- data/docs/AFNORRoutingCodePost201Response.md +0 -22
- data/docs/AFNORRoutingCodeSearch.md +0 -28
- data/docs/AFNORRoutingCodeSearchFilters.md +0 -30
- data/docs/AFNORRoutingCodeSearchFiltersAdministrativeStatus.md +0 -20
- data/docs/AFNORRoutingCodeSearchFiltersRoutingCodeName.md +0 -20
- data/docs/AFNORRoutingCodeSearchFiltersRoutingIdentifier.md +0 -20
- data/docs/AFNORRoutingCodeSearchPost200Response.md +0 -22
- data/docs/AFNORRoutingCodeSearchSortingInner.md +0 -20
- data/docs/AFNORSearchDirectoryLine.md +0 -26
- data/docs/AFNORSearchDirectoryLineFilters.md +0 -26
- data/docs/AFNORSearchDirectoryLineFiltersAddressingIdentifier.md +0 -20
- data/docs/AFNORSearchDirectoryLineFiltersAddressingSuffix.md +0 -20
- data/docs/AFNORSearchDirectoryLineSortingInner.md +0 -20
- data/docs/AFNORSearchFlowContent.md +0 -22
- data/docs/AFNORSearchFlowFilters.md +0 -30
- data/docs/AFNORSearchFlowParams.md +0 -20
- data/docs/AFNORSearchSiren.md +0 -26
- data/docs/AFNORSearchSirenFilters.md +0 -24
- data/docs/AFNORSearchSirenFiltersAdministrativeStatus.md +0 -20
- data/docs/AFNORSearchSirenFiltersBusinessName.md +0 -20
- data/docs/AFNORSearchSirenFiltersEntityType.md +0 -20
- data/docs/AFNORSearchSirenFiltersSiren.md +0 -20
- data/docs/AFNORSearchSirenSortingInner.md +0 -20
- data/docs/AFNORSearchSiret.md +0 -28
- data/docs/AFNORSearchSiretFilters.md +0 -34
- data/docs/AFNORSearchSiretFiltersAddressLines.md +0 -20
- data/docs/AFNORSearchSiretFiltersAdministrativeStatus.md +0 -20
- data/docs/AFNORSearchSiretFiltersCountrySubdivision.md +0 -20
- data/docs/AFNORSearchSiretFiltersFacilityType.md +0 -20
- data/docs/AFNORSearchSiretFiltersLocality.md +0 -20
- data/docs/AFNORSearchSiretFiltersName.md +0 -20
- data/docs/AFNORSearchSiretFiltersPostalCode.md +0 -20
- data/docs/AFNORSearchSiretFiltersSiret.md +0 -20
- data/docs/AFNORSearchSiretSortingInner.md +0 -20
- data/docs/AFNORSirenField.md +0 -15
- data/docs/AFNORSirenSearchPost200Response.md +0 -22
- data/docs/AFNORSiretField.md +0 -15
- data/docs/AFNORSiretSearchPost200Response.md +0 -22
- data/docs/AFNORSortingOrder.md +0 -15
- data/docs/AFNORStrictOperator.md +0 -15
- data/docs/AFNORUpdatePatchDirectoryLineBody.md +0 -18
- data/docs/AFNORUpdatePatchRoutingCodeBody.md +0 -24
- data/docs/AFNORUpdatePutRoutingCodeBody.md +0 -24
- data/docs/AFNORWebhookCallbackContent.md +0 -18
- data/docs/AcknowledgmentStatus.md +0 -15
- data/docs/ActionCodeInfo.md +0 -22
- data/docs/ActionCodesResponse.md +0 -22
- data/docs/AdditionalDocument.md +0 -26
- data/docs/AggregatedPaymentInput.md +0 -22
- data/docs/AggregatedTransactionInput.md +0 -32
- data/docs/AllowanceCharge.md +0 -32
- data/docs/AllowanceChargeReasonCode.md +0 -15
- data/docs/AllowanceReasonCode.md +0 -15
- data/docs/AllowanceTotalAmount.md +0 -15
- data/docs/AsyncTaskStatus.md +0 -22
- data/docs/AsyncTasksApi.md +0 -82
- data/docs/BaseAmount.md +0 -15
- data/docs/BoundingBoxSchema.md +0 -30
- data/docs/Buyercountry.md +0 -15
- data/docs/CeleryStatus.md +0 -15
- data/docs/ChargeTotalAmount.md +0 -15
- data/docs/ChorusProDestination.md +0 -20
- data/docs/ChorusProResult.md +0 -22
- data/docs/ClientActivateResponse.md +0 -22
- data/docs/ClientCreateRequest.md +0 -22
- data/docs/ClientDetail.md +0 -38
- data/docs/ClientListResponse.md +0 -24
- data/docs/ClientManagementApi.md +0 -921
- data/docs/ClientSummary.md +0 -38
- data/docs/ClientUpdateRequest.md +0 -22
- data/docs/Contact.md +0 -24
- data/docs/ConvertResumeRequest.md +0 -18
- data/docs/ConvertSuccessResponse.md +0 -36
- data/docs/ConvertValidationFailedResponse.md +0 -34
- data/docs/CountryCode.md +0 -15
- data/docs/CreateAggregatedReportRequest.md +0 -36
- data/docs/CreateCDARRequest.md +0 -52
- data/docs/CreateEReportingRequest.md +0 -38
- data/docs/Currency.md +0 -15
- data/docs/CurrencyCode.md +0 -15
- data/docs/DeliveryParty.md +0 -24
- data/docs/DocType.md +0 -15
- data/docs/DocumentTypeInfo.md +0 -22
- data/docs/DownloadsApi.md +0 -161
- data/docs/EReportingFlowType.md +0 -15
- data/docs/EReportingValidationError.md +0 -22
- data/docs/ElectronicAddress.md +0 -20
- data/docs/ElectronicSignatureApi.md +0 -339
- data/docs/Encaisseamount.md +0 -15
- data/docs/Encaisseamount1.md +0 -15
- data/docs/EncaisseeRequest.md +0 -40
- data/docs/EnrichedInvoiceInfo.md +0 -32
- data/docs/ExtractionInfo.md +0 -24
- data/docs/FacturXConversionApi.md +0 -319
- data/docs/FacturXGenerationApi.md +0 -254
- data/docs/FacturXInvoice.md +0 -76
- data/docs/FacturXPDFInfo.md +0 -22
- data/docs/FacturXPDFXMLVerificationApi.md +0 -240
- data/docs/FacturXValidationApi.md +0 -256
- data/docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md +0 -15
- data/docs/FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.md +0 -18
- data/docs/FieldStatus.md +0 -15
- data/docs/FileInfo.md +0 -20
- data/docs/FilesInfo.md +0 -20
- data/docs/FlowDirection.md +0 -15
- data/docs/FlowProfile.md +0 -15
- data/docs/FlowSummary.md +0 -32
- data/docs/FlowSyntax.md +0 -15
- data/docs/FlowType.md +0 -15
- data/docs/Flux10EReportingApi.md +0 -814
- data/docs/Flux6InvoiceLifecycleCDARApi.md +0 -698
- data/docs/GenerateAggregatedReportResponse.md +0 -30
- data/docs/GenerateCDARResponse.md +0 -26
- data/docs/GenerateEReportingResponse.md +0 -26
- data/docs/GetChorusProIdRequest.md +0 -22
- data/docs/GetChorusProIdResponse.md +0 -24
- data/docs/GetInvoiceResponse.md +0 -34
- data/docs/GetStructureRequest.md +0 -22
- data/docs/GetStructureResponse.md +0 -34
- data/docs/GlobalAllowanceAmount.md +0 -15
- data/docs/GrossUnitPrice.md +0 -15
- data/docs/HealthApi.md +0 -203
- data/docs/IncomingInvoice.md +0 -54
- data/docs/IncomingSupplier.md +0 -32
- data/docs/InvoiceFormat.md +0 -15
- data/docs/InvoiceInput.md +0 -50
- data/docs/InvoiceLine.md +0 -84
- data/docs/InvoiceLineAllowanceAmount.md +0 -15
- data/docs/InvoicePaymentInput.md +0 -26
- data/docs/InvoiceReferences.md +0 -52
- data/docs/InvoiceTotals.md +0 -38
- data/docs/InvoiceTotalsPrepayment.md +0 -15
- data/docs/InvoiceTypeCode.md +0 -15
- data/docs/InvoiceTypeCodeOutput.md +0 -15
- data/docs/InvoicingFramework.md +0 -24
- data/docs/InvoicingFrameworkCode.md +0 -15
- data/docs/IssuerRoleCode.md +0 -15
- data/docs/KeyRotationRequest.md +0 -20
- data/docs/KeyRotationResponse.md +0 -24
- data/docs/LineNetAmount.md +0 -15
- data/docs/LineSubType.md +0 -15
- data/docs/LineTotalAmount.md +0 -15
- data/docs/LocationInner.md +0 -15
- data/docs/MandatoryNoteSchema.md +0 -30
- data/docs/ManualRate.md +0 -15
- data/docs/ManualVatRate.md +0 -15
- data/docs/MissingField.md +0 -28
- data/docs/OperationNature.md +0 -15
- data/docs/OutputFormat.md +0 -15
- data/docs/PDFValidationResultAPI.md +0 -62
- data/docs/PDPConfigResponse.md +0 -46
- data/docs/PDPConfigUpdateRequest.md +0 -30
- data/docs/PDPCredentials.md +0 -26
- data/docs/PageDimensionsSchema.md +0 -20
- data/docs/Payee.md +0 -32
- data/docs/PaymentAmountByRate.md +0 -20
- data/docs/PaymentCard.md +0 -20
- data/docs/PaymentMeans.md +0 -15
- data/docs/Percentage.md +0 -15
- data/docs/PostalAddress.md +0 -30
- data/docs/PriceAllowanceAmount.md +0 -15
- data/docs/PriceBasisQuantity.md +0 -15
- data/docs/ProcessingOptions.md +0 -24
- data/docs/ProcessingRule.md +0 -15
- data/docs/ProductCharacteristic.md +0 -20
- data/docs/ProductClassification.md +0 -22
- data/docs/Quantity.md +0 -15
- data/docs/Rate1.md +0 -15
- data/docs/ReasonCodeInfo.md +0 -22
- data/docs/ReasonCodesResponse.md +0 -22
- data/docs/Recipient.md +0 -34
- data/docs/RecipientInput.md +0 -26
- data/docs/RefuseeRequest.md +0 -40
- data/docs/ReportIssuer.md +0 -24
- data/docs/ReportPeriod.md +0 -20
- data/docs/ReportSender.md +0 -22
- data/docs/RoundingAmount.md +0 -15
- data/docs/SchematronValidationError.md +0 -32
- data/docs/SearchFlowRequest.md +0 -34
- data/docs/SearchFlowResponse.md +0 -24
- data/docs/SearchServicesResponse.md +0 -24
- data/docs/SearchStructureRequest.md +0 -26
- data/docs/SearchStructureResponse.md +0 -24
- data/docs/SecretStatus.md +0 -24
- data/docs/Sellercountry.md +0 -15
- data/docs/SignatureInfoAPI.md +0 -28
- data/docs/SignatureParameters.md +0 -34
- data/docs/SimplifiedCDARResponse.md +0 -26
- data/docs/SimplifiedInvoiceData.md +0 -42
- data/docs/StatusCodeInfo.md +0 -22
- data/docs/StatusCodesResponse.md +0 -22
- data/docs/StructureParameters.md +0 -22
- data/docs/StructureService.md +0 -24
- data/docs/SubmissionMode.md +0 -15
- data/docs/SubmitAggregatedReportRequest.md +0 -28
- data/docs/SubmitCDARRequest.md +0 -62
- data/docs/SubmitCDARResponse.md +0 -24
- data/docs/SubmitCDARXMLRequest.md +0 -30
- data/docs/SubmitCompleteInvoiceRequest.md +0 -26
- data/docs/SubmitCompleteInvoiceResponse.md +0 -34
- data/docs/SubmitEReportingRequest.md +0 -28
- data/docs/SubmitEReportingResponse.md +0 -32
- data/docs/SubmitFlowRequest.md +0 -28
- data/docs/SubmitFlowResponse.md +0 -30
- data/docs/SubmitGrossAmount.md +0 -15
- data/docs/SubmitInvoiceRequest.md +0 -46
- data/docs/SubmitInvoiceResponse.md +0 -24
- data/docs/SubmitNetAmount.md +0 -15
- data/docs/SubmitVatAmount.md +0 -15
- data/docs/SupplementaryAttachment.md +0 -26
- data/docs/Supplier.md +0 -52
- data/docs/TaskResponse.md +0 -18
- data/docs/TaxBreakdownInput.md +0 -22
- data/docs/TaxDueDateType.md +0 -15
- data/docs/TaxRepresentative.md +0 -22
- data/docs/TaxableAmount.md +0 -15
- data/docs/Taxableamount.md +0 -15
- data/docs/Taxamount.md +0 -15
- data/docs/Taxamount1.md +0 -15
- data/docs/Taxamount2.md +0 -15
- data/docs/Taxexclusiveamount.md +0 -15
- data/docs/Taxexclusiveamount1.md +0 -15
- data/docs/TotalGrossAmount.md +0 -15
- data/docs/TotalNetAmount.md +0 -15
- data/docs/TotalVATAmount.md +0 -15
- data/docs/TransactionCategory.md +0 -15
- data/docs/TransmissionTypeCode.md +0 -15
- data/docs/UnitNetPrice.md +0 -15
- data/docs/UnitOfMeasure.md +0 -15
- data/docs/VATAccountingCode.md +0 -15
- data/docs/VATAmount.md +0 -15
- data/docs/VATCategory.md +0 -15
- data/docs/VATLine.md +0 -32
- data/docs/VATPointDateCode.md +0 -15
- data/docs/ValidateCDARRequest.md +0 -32
- data/docs/ValidateCDARResponse.md +0 -22
- data/docs/ValidateEReportingRequest.md +0 -18
- data/docs/ValidateEReportingResponse.md +0 -28
- data/docs/ValidationErrorResponse.md +0 -24
- data/docs/ValidationInfo.md +0 -28
- data/docs/ValidationSuccessResponse.md +0 -18
- data/docs/VatRate.md +0 -15
- data/docs/VerificationSuccessResponse.md +0 -36
- data/docs/VerifiedFieldSchema.md +0 -34
- data/docs/WebhookSecretDeleteResponse.md +0 -20
- data/docs/WebhookSecretGenerateResponse.md +0 -24
- data/docs/WebhookSecretStatusResponse.md +0 -20
- data/lib/factpulse/api/async_tasks_api.rb +0 -85
- data/lib/factpulse/api/client_management_api.rb +0 -831
- data/lib/factpulse/api/downloads_api.rb +0 -151
- data/lib/factpulse/api/electronic_signature_api.rb +0 -339
- data/lib/factpulse/api/factur_x_conversion_api.rb +0 -306
- data/lib/factpulse/api/factur_x_generation_api.rb +0 -254
- data/lib/factpulse/api/factur_x_validation_api.rb +0 -256
- data/lib/factpulse/api/factur_xpdfxml_verification_api.rb +0 -232
- data/lib/factpulse/api/flux10_e_reporting_api.rb +0 -777
- data/lib/factpulse/api/flux6_invoice_lifecycle_cdar_api.rb +0 -670
- data/lib/factpulse/api/health_api.rb +0 -193
- data/lib/factpulse/helpers/helpers.rb +0 -14
- data/lib/factpulse/models/acknowledgment_status.rb +0 -41
- data/lib/factpulse/models/action_code_info.rb +0 -220
- data/lib/factpulse/models/action_codes_response.rb +0 -207
- data/lib/factpulse/models/additional_document.rb +0 -206
- data/lib/factpulse/models/afnor_acknowledgement.rb +0 -216
- data/lib/factpulse/models/afnor_acknowledgement_detail.rb +0 -267
- data/lib/factpulse/models/afnor_address_edit.rb +0 -353
- data/lib/factpulse/models/afnor_address_patch.rb +0 -386
- data/lib/factpulse/models/afnor_address_put.rb +0 -435
- data/lib/factpulse/models/afnor_address_read.rb +0 -382
- data/lib/factpulse/models/afnor_algorithm.rb +0 -43
- data/lib/factpulse/models/afnor_contains_operator.rb +0 -39
- data/lib/factpulse/models/afnor_create_directory_line_body.rb +0 -156
- data/lib/factpulse/models/afnor_create_directory_line_body_addressing_information.rb +0 -294
- data/lib/factpulse/models/afnor_create_directory_line_body_period.rb +0 -175
- data/lib/factpulse/models/afnor_create_routing_code_body.rb +0 -412
- data/lib/factpulse/models/afnor_credentials.rb +0 -169
- data/lib/factpulse/models/afnor_destination.rb +0 -224
- data/lib/factpulse/models/afnor_diffusion_status.rb +0 -40
- data/lib/factpulse/models/afnor_directory_line_field.rb +0 -44
- data/lib/factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code.rb +0 -312
- data/lib/factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code_platform.rb +0 -178
- data/lib/factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code_routing_code.rb +0 -308
- data/lib/factpulse/models/afnor_directory_line_post201_response.rb +0 -187
- data/lib/factpulse/models/afnor_directory_line_search_post200_response.rb +0 -168
- data/lib/factpulse/models/afnor_entity_type.rb +0 -40
- data/lib/factpulse/models/afnor_error.rb +0 -214
- data/lib/factpulse/models/afnor_facility_administrative_status.rb +0 -40
- data/lib/factpulse/models/afnor_facility_nature.rb +0 -40
- data/lib/factpulse/models/afnor_facility_payload_history.rb +0 -323
- data/lib/factpulse/models/afnor_facility_payload_history_ule_b2g_additional_data.rb +0 -198
- data/lib/factpulse/models/afnor_facility_payload_included.rb +0 -314
- data/lib/factpulse/models/afnor_facility_type.rb +0 -40
- data/lib/factpulse/models/afnor_flow.rb +0 -315
- data/lib/factpulse/models/afnor_flow_ack_status.rb +0 -41
- data/lib/factpulse/models/afnor_flow_direction.rb +0 -40
- data/lib/factpulse/models/afnor_flow_info.rb +0 -293
- data/lib/factpulse/models/afnor_flow_profile.rb +0 -41
- data/lib/factpulse/models/afnor_flow_syntax.rb +0 -43
- data/lib/factpulse/models/afnor_flow_type.rb +0 -51
- data/lib/factpulse/models/afnor_full_flow_info.rb +0 -339
- data/lib/factpulse/models/afnor_health_check_response.rb +0 -220
- data/lib/factpulse/models/afnor_legal_unit_administrative_status.rb +0 -40
- data/lib/factpulse/models/afnor_legal_unit_payload_history.rb +0 -247
- data/lib/factpulse/models/afnor_legal_unit_payload_included.rb +0 -247
- data/lib/factpulse/models/afnor_legal_unit_payload_included_no_siren.rb +0 -207
- data/lib/factpulse/models/afnor_platform_status.rb +0 -40
- data/lib/factpulse/models/afnor_processing_rule.rb +0 -44
- data/lib/factpulse/models/afnor_reason_code.rb +0 -105
- data/lib/factpulse/models/afnor_reason_code_enum.rb +0 -53
- data/lib/factpulse/models/afnor_recipient_platform_type.rb +0 -40
- data/lib/factpulse/models/afnor_result.rb +0 -270
- data/lib/factpulse/models/afnor_routing_code_administrative_status.rb +0 -40
- data/lib/factpulse/models/afnor_routing_code_field.rb +0 -46
- data/lib/factpulse/models/afnor_routing_code_payload_history_legal_unit_facility.rb +0 -366
- data/lib/factpulse/models/afnor_routing_code_post201_response.rb +0 -228
- data/lib/factpulse/models/afnor_routing_code_search.rb +0 -224
- data/lib/factpulse/models/afnor_routing_code_search_filters.rb +0 -201
- data/lib/factpulse/models/afnor_routing_code_search_filters_administrative_status.rb +0 -178
- data/lib/factpulse/models/afnor_routing_code_search_filters_routing_code_name.rb +0 -209
- data/lib/factpulse/models/afnor_routing_code_search_filters_routing_identifier.rb +0 -209
- data/lib/factpulse/models/afnor_routing_code_search_post200_response.rb +0 -168
- data/lib/factpulse/models/afnor_routing_code_search_sorting_inner.rb +0 -179
- data/lib/factpulse/models/afnor_search_directory_line.rb +0 -191
- data/lib/factpulse/models/afnor_search_directory_line_filters.rb +0 -183
- data/lib/factpulse/models/afnor_search_directory_line_filters_addressing_identifier.rb +0 -198
- data/lib/factpulse/models/afnor_search_directory_line_filters_addressing_suffix.rb +0 -198
- data/lib/factpulse/models/afnor_search_directory_line_sorting_inner.rb +0 -179
- data/lib/factpulse/models/afnor_search_flow_content.rb +0 -168
- data/lib/factpulse/models/afnor_search_flow_filters.rb +0 -250
- data/lib/factpulse/models/afnor_search_flow_params.rb +0 -195
- data/lib/factpulse/models/afnor_search_siren.rb +0 -191
- data/lib/factpulse/models/afnor_search_siren_filters.rb +0 -174
- data/lib/factpulse/models/afnor_search_siren_filters_administrative_status.rb +0 -178
- data/lib/factpulse/models/afnor_search_siren_filters_business_name.rb +0 -198
- data/lib/factpulse/models/afnor_search_siren_filters_entity_type.rb +0 -178
- data/lib/factpulse/models/afnor_search_siren_filters_siren.rb +0 -209
- data/lib/factpulse/models/afnor_search_siren_sorting_inner.rb +0 -179
- data/lib/factpulse/models/afnor_search_siret.rb +0 -224
- data/lib/factpulse/models/afnor_search_siret_filters.rb +0 -219
- data/lib/factpulse/models/afnor_search_siret_filters_address_lines.rb +0 -198
- data/lib/factpulse/models/afnor_search_siret_filters_administrative_status.rb +0 -178
- data/lib/factpulse/models/afnor_search_siret_filters_country_subdivision.rb +0 -198
- data/lib/factpulse/models/afnor_search_siret_filters_facility_type.rb +0 -178
- data/lib/factpulse/models/afnor_search_siret_filters_locality.rb +0 -198
- data/lib/factpulse/models/afnor_search_siret_filters_name.rb +0 -198
- data/lib/factpulse/models/afnor_search_siret_filters_postal_code.rb +0 -209
- data/lib/factpulse/models/afnor_search_siret_filters_siret.rb +0 -209
- data/lib/factpulse/models/afnor_search_siret_sorting_inner.rb +0 -179
- data/lib/factpulse/models/afnor_siren_field.rb +0 -43
- data/lib/factpulse/models/afnor_siren_search_post200_response.rb +0 -168
- data/lib/factpulse/models/afnor_siret_field.rb +0 -52
- data/lib/factpulse/models/afnor_siret_search_post200_response.rb +0 -168
- data/lib/factpulse/models/afnor_sorting_order.rb +0 -40
- data/lib/factpulse/models/afnor_strict_operator.rb +0 -39
- data/lib/factpulse/models/afnor_update_patch_directory_line_body.rb +0 -148
- data/lib/factpulse/models/afnor_update_patch_routing_code_body.rb +0 -258
- data/lib/factpulse/models/afnor_update_put_routing_code_body.rb +0 -289
- data/lib/factpulse/models/afnor_webhook_callback_content.rb +0 -148
- data/lib/factpulse/models/aggregated_payment_input.rb +0 -213
- data/lib/factpulse/models/aggregated_transaction_input.rb +0 -349
- data/lib/factpulse/models/allowance_charge.rb +0 -274
- data/lib/factpulse/models/allowance_charge_reason_code.rb +0 -76
- data/lib/factpulse/models/allowance_reason_code.rb +0 -45
- data/lib/factpulse/models/allowance_total_amount.rb +0 -104
- data/lib/factpulse/models/amount.rb +0 -104
- data/lib/factpulse/models/amount1.rb +0 -104
- data/lib/factpulse/models/amount2.rb +0 -104
- data/lib/factpulse/models/amount_due.rb +0 -104
- data/lib/factpulse/models/api_profile.rb +0 -43
- data/lib/factpulse/models/async_task_status.rb +0 -227
- data/lib/factpulse/models/base_amount.rb +0 -104
- data/lib/factpulse/models/bounding_box_schema.rb +0 -332
- data/lib/factpulse/models/buyercountry.rb +0 -104
- data/lib/factpulse/models/celery_status.rb +0 -43
- data/lib/factpulse/models/charge_total_amount.rb +0 -104
- data/lib/factpulse/models/chorus_pro_destination.rb +0 -194
- data/lib/factpulse/models/chorus_pro_result.rb +0 -186
- data/lib/factpulse/models/client_activate_response.rb +0 -220
- data/lib/factpulse/models/client_create_request.rb +0 -236
- data/lib/factpulse/models/client_detail.rb +0 -368
- data/lib/factpulse/models/client_list_response.rb +0 -249
- data/lib/factpulse/models/client_summary.rb +0 -368
- data/lib/factpulse/models/client_update_request.rb +0 -225
- data/lib/factpulse/models/contact.rb +0 -179
- data/lib/factpulse/models/convert_resume_request.rb +0 -151
- data/lib/factpulse/models/convert_success_response.rb +0 -360
- data/lib/factpulse/models/convert_validation_failed_response.rb +0 -339
- data/lib/factpulse/models/country_code.rb +0 -208
- data/lib/factpulse/models/create_aggregated_report_request.rb +0 -320
- data/lib/factpulse/models/create_cdar_request.rb +0 -414
- data/lib/factpulse/models/create_e_reporting_request.rb +0 -347
- data/lib/factpulse/models/currency.rb +0 -104
- data/lib/factpulse/models/currency_code.rb +0 -91
- data/lib/factpulse/models/delivery_party.rb +0 -179
- data/lib/factpulse/models/doc_type.rb +0 -42
- data/lib/factpulse/models/document_type_info.rb +0 -220
- data/lib/factpulse/models/e_reporting_flow_type.rb +0 -42
- data/lib/factpulse/models/e_reporting_validation_error.rb +0 -203
- data/lib/factpulse/models/electronic_address.rb +0 -198
- data/lib/factpulse/models/encaisseamount.rb +0 -104
- data/lib/factpulse/models/encaisseamount1.rb +0 -103
- data/lib/factpulse/models/encaissee_request.rb +0 -347
- data/lib/factpulse/models/enriched_invoice_info.rb +0 -354
- data/lib/factpulse/models/extraction_info.rb +0 -217
- data/lib/factpulse/models/factur_x_invoice.rb +0 -580
- data/lib/factpulse/models/factur_xpdf_info.rb +0 -205
- data/lib/factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code.rb +0 -43
- data/lib/factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb +0 -191
- data/lib/factpulse/models/facture_electronique_rest_api_schemas_validation_validation_error_response.rb +0 -168
- data/lib/factpulse/models/field_status.rb +0 -43
- data/lib/factpulse/models/file_info.rb +0 -161
- data/lib/factpulse/models/files_info.rb +0 -159
- data/lib/factpulse/models/flow_direction.rb +0 -40
- data/lib/factpulse/models/flow_profile.rb +0 -41
- data/lib/factpulse/models/flow_summary.rb +0 -253
- data/lib/factpulse/models/flow_syntax.rb +0 -43
- data/lib/factpulse/models/flow_type.rb +0 -51
- data/lib/factpulse/models/generate_aggregated_report_response.rb +0 -330
- data/lib/factpulse/models/generate_cdar_response.rb +0 -273
- data/lib/factpulse/models/generate_e_reporting_response.rb +0 -274
- data/lib/factpulse/models/get_chorus_pro_id_request.rb +0 -188
- data/lib/factpulse/models/get_chorus_pro_id_response.rb +0 -230
- data/lib/factpulse/models/get_invoice_request.rb +0 -176
- data/lib/factpulse/models/get_invoice_response.rb +0 -263
- data/lib/factpulse/models/get_structure_request.rb +0 -188
- data/lib/factpulse/models/get_structure_response.rb +0 -263
- data/lib/factpulse/models/global_allowance_amount.rb +0 -104
- data/lib/factpulse/models/gross_unit_price.rb +0 -104
- data/lib/factpulse/models/incoming_invoice.rb +0 -489
- data/lib/factpulse/models/incoming_supplier.rb +0 -236
- data/lib/factpulse/models/invoice_format.rb +0 -41
- data/lib/factpulse/models/invoice_input.rb +0 -439
- data/lib/factpulse/models/invoice_line.rb +0 -593
- data/lib/factpulse/models/invoice_line_allowance_amount.rb +0 -104
- data/lib/factpulse/models/invoice_note.rb +0 -176
- data/lib/factpulse/models/invoice_payment_input.rb +0 -267
- data/lib/factpulse/models/invoice_references.rb +0 -393
- data/lib/factpulse/models/invoice_status.rb +0 -203
- data/lib/factpulse/models/invoice_totals.rb +0 -312
- data/lib/factpulse/models/invoice_totals_prepayment.rb +0 -104
- data/lib/factpulse/models/invoice_type_code.rb +0 -54
- data/lib/factpulse/models/invoice_type_code_output.rb +0 -54
- data/lib/factpulse/models/invoicing_framework.rb +0 -218
- data/lib/factpulse/models/invoicing_framework_code.rb +0 -42
- data/lib/factpulse/models/issuer_role_code.rb +0 -40
- data/lib/factpulse/models/key_rotation_request.rb +0 -211
- data/lib/factpulse/models/key_rotation_response.rb +0 -232
- data/lib/factpulse/models/line_net_amount.rb +0 -104
- data/lib/factpulse/models/line_sub_type.rb +0 -41
- data/lib/factpulse/models/line_total_amount.rb +0 -104
- data/lib/factpulse/models/location_inner.rb +0 -103
- data/lib/factpulse/models/mandatory_note_schema.rb +0 -265
- data/lib/factpulse/models/manual_rate.rb +0 -104
- data/lib/factpulse/models/manual_vat_rate.rb +0 -104
- data/lib/factpulse/models/missing_field.rb +0 -269
- data/lib/factpulse/models/operation_nature.rb +0 -52
- data/lib/factpulse/models/output_format.rb +0 -40
- data/lib/factpulse/models/page_dimensions_schema.rb +0 -193
- data/lib/factpulse/models/payee.rb +0 -281
- data/lib/factpulse/models/payment_amount_by_rate.rb +0 -191
- data/lib/factpulse/models/payment_card.rb +0 -159
- data/lib/factpulse/models/payment_means.rb +0 -44
- data/lib/factpulse/models/pdf_validation_result_api.rb +0 -523
- data/lib/factpulse/models/pdp_config_response.rb +0 -306
- data/lib/factpulse/models/pdp_config_update_request.rb +0 -315
- data/lib/factpulse/models/pdp_credentials.rb +0 -257
- data/lib/factpulse/models/percentage.rb +0 -104
- data/lib/factpulse/models/postal_address.rb +0 -209
- data/lib/factpulse/models/price_allowance_amount.rb +0 -104
- data/lib/factpulse/models/price_basis_quantity.rb +0 -104
- data/lib/factpulse/models/processing_options.rb +0 -207
- data/lib/factpulse/models/processing_rule.rb +0 -44
- data/lib/factpulse/models/product_characteristic.rb +0 -193
- data/lib/factpulse/models/product_classification.rb +0 -186
- data/lib/factpulse/models/quantity.rb +0 -104
- data/lib/factpulse/models/rate.rb +0 -104
- data/lib/factpulse/models/rate1.rb +0 -104
- data/lib/factpulse/models/reason_code_info.rb +0 -220
- data/lib/factpulse/models/reason_codes_response.rb +0 -207
- data/lib/factpulse/models/recipient.rb +0 -231
- data/lib/factpulse/models/recipient_input.rb +0 -191
- data/lib/factpulse/models/refusee_request.rb +0 -346
- data/lib/factpulse/models/report_issuer.rb +0 -236
- data/lib/factpulse/models/report_period.rb +0 -193
- data/lib/factpulse/models/report_sender.rb +0 -221
- data/lib/factpulse/models/rounding_amount.rb +0 -104
- data/lib/factpulse/models/schematron_validation_error.rb +0 -294
- data/lib/factpulse/models/search_flow_request.rb +0 -306
- data/lib/factpulse/models/search_flow_response.rb +0 -249
- data/lib/factpulse/models/search_services_response.rb +0 -217
- data/lib/factpulse/models/search_structure_request.rb +0 -191
- data/lib/factpulse/models/search_structure_response.rb +0 -216
- data/lib/factpulse/models/secret_status.rb +0 -213
- data/lib/factpulse/models/sellercountry.rb +0 -104
- data/lib/factpulse/models/signature_info_api.rb +0 -216
- data/lib/factpulse/models/signature_parameters.rb +0 -235
- data/lib/factpulse/models/simplified_cdar_response.rb +0 -274
- data/lib/factpulse/models/simplified_invoice_data.rb +0 -404
- data/lib/factpulse/models/status_code_info.rb +0 -220
- data/lib/factpulse/models/status_codes_response.rb +0 -207
- data/lib/factpulse/models/structure_parameters.rb +0 -175
- data/lib/factpulse/models/structure_service.rb +0 -247
- data/lib/factpulse/models/submission_mode.rb +0 -41
- data/lib/factpulse/models/submit_aggregated_report_request.rb +0 -216
- data/lib/factpulse/models/submit_cdar_request.rb +0 -466
- data/lib/factpulse/models/submit_cdar_response.rb +0 -213
- data/lib/factpulse/models/submit_cdarxml_request.rb +0 -228
- data/lib/factpulse/models/submit_complete_invoice_request.rb +0 -239
- data/lib/factpulse/models/submit_complete_invoice_response.rb +0 -355
- data/lib/factpulse/models/submit_e_reporting_request.rb +0 -216
- data/lib/factpulse/models/submit_e_reporting_response.rb +0 -306
- data/lib/factpulse/models/submit_flow_request.rb +0 -238
- data/lib/factpulse/models/submit_flow_response.rb +0 -294
- data/lib/factpulse/models/submit_gross_amount.rb +0 -104
- data/lib/factpulse/models/submit_invoice_request.rb +0 -388
- data/lib/factpulse/models/submit_invoice_response.rb +0 -213
- data/lib/factpulse/models/submit_net_amount.rb +0 -104
- data/lib/factpulse/models/submit_vat_amount.rb +0 -104
- data/lib/factpulse/models/supplementary_attachment.rb +0 -274
- data/lib/factpulse/models/supplier.rb +0 -337
- data/lib/factpulse/models/task_response.rb +0 -166
- data/lib/factpulse/models/tax_breakdown_input.rb +0 -217
- data/lib/factpulse/models/tax_due_date_type.rb +0 -44
- data/lib/factpulse/models/tax_representative.rb +0 -220
- data/lib/factpulse/models/taxable_amount.rb +0 -104
- data/lib/factpulse/models/taxableamount.rb +0 -104
- data/lib/factpulse/models/taxamount.rb +0 -104
- data/lib/factpulse/models/taxamount1.rb +0 -104
- data/lib/factpulse/models/taxamount2.rb +0 -104
- data/lib/factpulse/models/taxexclusiveamount.rb +0 -104
- data/lib/factpulse/models/taxexclusiveamount1.rb +0 -104
- data/lib/factpulse/models/total_gross_amount.rb +0 -104
- data/lib/factpulse/models/total_net_amount.rb +0 -104
- data/lib/factpulse/models/total_vat_amount.rb +0 -104
- data/lib/factpulse/models/transaction_category.rb +0 -42
- data/lib/factpulse/models/transmission_type_code.rb +0 -40
- data/lib/factpulse/models/unit_net_price.rb +0 -104
- data/lib/factpulse/models/unit_of_measure.rb +0 -44
- data/lib/factpulse/models/validate_cdar_request.rb +0 -219
- data/lib/factpulse/models/validate_cdar_response.rb +0 -190
- data/lib/factpulse/models/validate_e_reporting_request.rb +0 -166
- data/lib/factpulse/models/validate_e_reporting_response.rb +0 -271
- data/lib/factpulse/models/validation_error_response.rb +0 -215
- data/lib/factpulse/models/validation_info.rb +0 -255
- data/lib/factpulse/models/validation_success_response.rb +0 -166
- data/lib/factpulse/models/vat_accounting_code.rb +0 -42
- data/lib/factpulse/models/vat_amount.rb +0 -104
- data/lib/factpulse/models/vat_category.rb +0 -47
- data/lib/factpulse/models/vat_line.rb +0 -272
- data/lib/factpulse/models/vat_point_date_code.rb +0 -41
- data/lib/factpulse/models/vat_rate.rb +0 -104
- data/lib/factpulse/models/verification_success_response.rb +0 -343
- data/lib/factpulse/models/verified_field_schema.rb +0 -334
- data/lib/factpulse/models/webhook_secret_delete_response.rb +0 -193
- data/lib/factpulse/models/webhook_secret_generate_response.rb +0 -247
- data/lib/factpulse/models/webhook_secret_status_response.rb +0 -176
|
@@ -1,271 +1,299 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# FactPulse SDK - Thin HTTP wrapper with auto-polling.
|
|
4
|
-
#
|
|
5
|
-
# Usage:
|
|
6
|
-
# client = FactPulseClient.new('email', 'password', 'client_uid')
|
|
7
|
-
#
|
|
8
|
-
# # POST /api/v1/processing/invoices/submit-complete-async
|
|
9
|
-
# result = client.post('processing/invoices/submit-complete-async',
|
|
10
|
-
# invoiceData: {...},
|
|
11
|
-
# destination: { type: 'afnor' }
|
|
12
|
-
# )
|
|
13
|
-
# pdf_bytes = result['content'] # auto-decoded, auto-polled
|
|
14
|
-
|
|
15
|
-
require 'net/http'
|
|
16
|
-
require 'json'
|
|
17
|
-
require 'base64'
|
|
18
|
-
require 'uri'
|
|
2
|
+
require 'net/http'; require 'json'; require 'base64'; require 'uri'; require 'securerandom'
|
|
19
3
|
|
|
20
4
|
module FactPulse
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def initialize(email, password, client_uid, api_url: DEFAULT_API_URL, timeout: 60, polling_timeout: 120)
|
|
35
|
-
@email = email
|
|
36
|
-
@password = password
|
|
37
|
-
@client_uid = client_uid
|
|
38
|
-
@api_url = api_url.chomp('/')
|
|
39
|
-
@timeout = timeout
|
|
40
|
-
@polling_timeout = polling_timeout
|
|
41
|
-
@token = nil
|
|
42
|
-
@token_expires_at = 0
|
|
43
|
-
@token_mutex = Mutex.new
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
# POST request to /api/v1/{path} (JSON body)
|
|
47
|
-
def post(path, **data)
|
|
48
|
-
request('POST', path, data, retry_auth: true)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
# POST request with multipart/form-data (for file uploads)
|
|
52
|
-
def post_multipart(path, data: {}, files: {})
|
|
53
|
-
request_multipart(path, data, files, retry_auth: true)
|
|
5
|
+
module Helpers
|
|
6
|
+
# Credentials Chorus Pro pour le mode Zero-Trust.
|
|
7
|
+
# Ces credentials sont passés dans chaque requête et ne sont jamais stockés côté serveur.
|
|
8
|
+
class ChorusProCredentials
|
|
9
|
+
attr_reader :piste_client_id, :piste_client_secret, :chorus_pro_login, :chorus_pro_password, :sandbox
|
|
10
|
+
def initialize(piste_client_id:, piste_client_secret:, chorus_pro_login:, chorus_pro_password:, sandbox: true)
|
|
11
|
+
@piste_client_id, @piste_client_secret = piste_client_id, piste_client_secret
|
|
12
|
+
@chorus_pro_login, @chorus_pro_password, @sandbox = chorus_pro_login, chorus_pro_password, sandbox
|
|
13
|
+
end
|
|
14
|
+
def to_h
|
|
15
|
+
{ 'piste_client_id' => @piste_client_id, 'piste_client_secret' => @piste_client_secret,
|
|
16
|
+
'chorus_pro_login' => @chorus_pro_login, 'chorus_pro_password' => @chorus_pro_password, 'sandbox' => @sandbox }
|
|
17
|
+
end
|
|
54
18
|
end
|
|
55
19
|
|
|
56
|
-
#
|
|
57
|
-
|
|
58
|
-
|
|
20
|
+
# Credentials AFNOR PDP pour le mode Zero-Trust.
|
|
21
|
+
# L'API FactPulse utilise ces credentials pour s'authentifier auprès de la PDP AFNOR.
|
|
22
|
+
class AFNORCredentials
|
|
23
|
+
attr_reader :flow_service_url, :token_url, :client_id, :client_secret, :directory_service_url
|
|
24
|
+
def initialize(flow_service_url:, token_url:, client_id:, client_secret:, directory_service_url: nil)
|
|
25
|
+
@flow_service_url, @token_url = flow_service_url, token_url
|
|
26
|
+
@client_id, @client_secret, @directory_service_url = client_id, client_secret, directory_service_url
|
|
27
|
+
end
|
|
28
|
+
def to_h
|
|
29
|
+
result = { 'flow_service_url' => @flow_service_url, 'token_url' => @token_url,
|
|
30
|
+
'client_id' => @client_id, 'client_secret' => @client_secret }
|
|
31
|
+
result['directory_service_url'] = @directory_service_url if @directory_service_url
|
|
32
|
+
result
|
|
33
|
+
end
|
|
59
34
|
end
|
|
60
35
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
|
69
|
-
http.use_ssl = uri.scheme == 'https'
|
|
70
|
-
http.read_timeout = @timeout
|
|
71
|
-
|
|
72
|
-
if method == 'POST'
|
|
73
|
-
req = Net::HTTP::Post.new(uri)
|
|
74
|
-
req['Content-Type'] = 'application/json'
|
|
75
|
-
req.body = JSON.generate(data)
|
|
76
|
-
else
|
|
77
|
-
uri.query = URI.encode_www_form(data) unless data.empty?
|
|
78
|
-
req = Net::HTTP::Get.new(uri)
|
|
36
|
+
# Helpers pour créer des montants totaux simplifiés.
|
|
37
|
+
module MontantHelpers
|
|
38
|
+
def self.montant(value)
|
|
39
|
+
return '0.00' if value.nil?
|
|
40
|
+
return format('%.2f', value) if value.is_a?(Numeric)
|
|
41
|
+
value.is_a?(String) ? value : '0.00'
|
|
79
42
|
end
|
|
80
|
-
req['Authorization'] = "Bearer #{@token}"
|
|
81
43
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
44
|
+
def self.montant_total(ht, tva, ttc, a_payer, remise_ttc: nil, motif_remise: nil, acompte: nil)
|
|
45
|
+
result = {
|
|
46
|
+
'montantHtTotal' => montant(ht), 'montantTva' => montant(tva),
|
|
47
|
+
'montantTtcTotal' => montant(ttc), 'montantAPayer' => montant(a_payer)
|
|
48
|
+
}
|
|
49
|
+
result['montantRemiseGlobaleTtc'] = montant(remise_ttc) if remise_ttc
|
|
50
|
+
result['motifRemiseGlobaleTtc'] = motif_remise if motif_remise
|
|
51
|
+
result['acompte'] = montant(acompte) if acompte
|
|
52
|
+
result
|
|
87
53
|
end
|
|
88
54
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
55
|
+
# Crée une ligne de poste (aligné sur LigneDePoste de models.py).
|
|
56
|
+
def self.ligne_de_poste(numero, denomination, quantite, montant_unitaire_ht, montant_total_ligne_ht,
|
|
57
|
+
taux_tva: '20.00', categorie_tva: 'S', unite: 'FORFAIT', **options)
|
|
58
|
+
result = {
|
|
59
|
+
'numero' => numero, 'denomination' => denomination,
|
|
60
|
+
'quantite' => montant(quantite), 'montantUnitaireHt' => montant(montant_unitaire_ht),
|
|
61
|
+
'montantTotalLigneHt' => montant(montant_total_ligne_ht), 'tauxTva' => montant(taux_tva),
|
|
62
|
+
'categorieTva' => categorie_tva, 'unite' => unite
|
|
63
|
+
}
|
|
64
|
+
result['reference'] = options[:reference] if options[:reference]
|
|
65
|
+
result['montantRemiseHt'] = montant(options[:montant_remise_ht]) if options[:montant_remise_ht]
|
|
66
|
+
result['codeRaisonReduction'] = options[:code_raison_reduction] if options[:code_raison_reduction]
|
|
67
|
+
result['raisonReduction'] = options[:raison_reduction] if options[:raison_reduction]
|
|
68
|
+
result['dateDebutPeriode'] = options[:date_debut_periode] if options[:date_debut_periode]
|
|
69
|
+
result['dateFinPeriode'] = options[:date_fin_periode] if options[:date_fin_periode]
|
|
70
|
+
result
|
|
95
71
|
end
|
|
96
72
|
|
|
97
|
-
#
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
73
|
+
# Crée une ligne de TVA (aligné sur LigneDeTVA de models.py).
|
|
74
|
+
def self.ligne_de_tva(taux_manuel, montant_base_ht, montant_tva, categorie: 'S')
|
|
75
|
+
{
|
|
76
|
+
'tauxManuel' => montant(taux_manuel), 'montantBaseHt' => montant(montant_base_ht),
|
|
77
|
+
'montantTva' => montant(montant_tva), 'categorie' => categorie
|
|
78
|
+
}
|
|
101
79
|
end
|
|
102
80
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
uri = URI(url)
|
|
110
|
-
|
|
111
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
|
112
|
-
http.use_ssl = uri.scheme == 'https'
|
|
113
|
-
http.read_timeout = @timeout
|
|
114
|
-
|
|
115
|
-
# Build multipart body
|
|
116
|
-
boundary = "----RubyFormBoundary#{rand(1_000_000)}"
|
|
117
|
-
body = []
|
|
118
|
-
|
|
119
|
-
data.each do |key, value|
|
|
120
|
-
body << "--#{boundary}\r\n"
|
|
121
|
-
body << "Content-Disposition: form-data; name=\"#{key}\"\r\n\r\n"
|
|
122
|
-
body << "#{value}\r\n"
|
|
81
|
+
# Crée une adresse postale pour l'API FactPulse.
|
|
82
|
+
def self.adresse_postale(ligne1, code_postal, ville, pays: 'FR', ligne2: nil, ligne3: nil)
|
|
83
|
+
result = { 'ligneUn' => ligne1, 'codePostal' => code_postal, 'nomVille' => ville, 'paysCodeIso' => pays }
|
|
84
|
+
result['ligneDeux'] = ligne2 if ligne2
|
|
85
|
+
result['ligneTrois'] = ligne3 if ligne3
|
|
86
|
+
result
|
|
123
87
|
end
|
|
124
88
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
body << "Content-Type: application/octet-stream\r\n\r\n"
|
|
129
|
-
body << content
|
|
130
|
-
body << "\r\n"
|
|
89
|
+
# Crée une adresse électronique. scheme_id: "0009"=SIREN, "0225"=SIRET
|
|
90
|
+
def self.adresse_electronique(identifiant, scheme_id: '0009')
|
|
91
|
+
{ 'identifiant' => identifiant, 'schemeId' => scheme_id }
|
|
131
92
|
end
|
|
132
93
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
req.body = body.join
|
|
139
|
-
|
|
140
|
-
response = http.request(req)
|
|
141
|
-
|
|
142
|
-
if response.code == '401' && retry_auth
|
|
143
|
-
invalidate_token
|
|
144
|
-
return request_multipart(path, data, files, retry_auth: false)
|
|
94
|
+
# Calcule le numéro TVA intracommunautaire français depuis un SIREN.
|
|
95
|
+
def self.calculer_tva_intra(siren)
|
|
96
|
+
return nil if siren.nil? || siren.length != 9 || !siren.match?(/^\d+$/)
|
|
97
|
+
cle = (12 + 3 * (siren.to_i % 97)) % 97
|
|
98
|
+
format('FR%02d%s', cle, siren)
|
|
145
99
|
end
|
|
146
100
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
101
|
+
# Crée un fournisseur (émetteur) avec auto-calcul SIREN, TVA intracommunautaire et adresses.
|
|
102
|
+
def self.fournisseur(nom, siret, adresse_ligne1, code_postal, ville, **options)
|
|
103
|
+
siren = options[:siren] || (siret.length == 14 ? siret[0, 9] : nil)
|
|
104
|
+
numero_tva_intra = options[:numero_tva_intra] || (siren ? calculer_tva_intra(siren) : nil)
|
|
105
|
+
result = {
|
|
106
|
+
'nom' => nom, 'idFournisseur' => options[:id_fournisseur] || 0, 'siret' => siret,
|
|
107
|
+
'adresseElectronique' => adresse_electronique(siret, scheme_id: '0225'),
|
|
108
|
+
'adressePostale' => adresse_postale(adresse_ligne1, code_postal, ville, pays: options[:pays] || 'FR', ligne2: options[:adresse_ligne2])
|
|
109
|
+
}
|
|
110
|
+
result['siren'] = siren if siren
|
|
111
|
+
result['numeroTvaIntra'] = numero_tva_intra if numero_tva_intra
|
|
112
|
+
result['iban'] = options[:iban] if options[:iban]
|
|
113
|
+
result['idServiceFournisseur'] = options[:code_service] if options[:code_service]
|
|
114
|
+
result['codeCoordonnesBancairesFournisseur'] = options[:code_coordonnees_bancaires] if options[:code_coordonnees_bancaires]
|
|
115
|
+
result
|
|
153
116
|
end
|
|
154
117
|
|
|
155
|
-
#
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
result
|
|
118
|
+
# Crée un destinataire (client) avec auto-calcul SIREN et adresses.
|
|
119
|
+
def self.destinataire(nom, siret, adresse_ligne1, code_postal, ville, **options)
|
|
120
|
+
siren = options[:siren] || (siret.length == 14 ? siret[0, 9] : nil)
|
|
121
|
+
result = {
|
|
122
|
+
'nom' => nom, 'siret' => siret,
|
|
123
|
+
'adresseElectronique' => adresse_electronique(siret, scheme_id: '0225'),
|
|
124
|
+
'adressePostale' => adresse_postale(adresse_ligne1, code_postal, ville, pays: options[:pays] || 'FR', ligne2: options[:adresse_ligne2])
|
|
125
|
+
}
|
|
126
|
+
result['siren'] = siren if siren
|
|
127
|
+
result['codeServiceExecutant'] = options[:code_service_executant] if options[:code_service_executant]
|
|
128
|
+
result
|
|
159
129
|
end
|
|
160
|
-
|
|
161
|
-
result
|
|
162
130
|
end
|
|
163
131
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
data = body && !body.empty? ? JSON.parse(body) : {}
|
|
132
|
+
class FactPulseClient
|
|
133
|
+
attr_reader :chorus_credentials, :afnor_credentials
|
|
167
134
|
|
|
168
|
-
|
|
135
|
+
def initialize(email:, password:, api_url: nil, client_uid: nil, chorus_credentials: nil, afnor_credentials: nil,
|
|
136
|
+
polling_interval: nil, polling_timeout: nil, max_retries: nil)
|
|
137
|
+
@email, @password = email, password; @api_url = (api_url || 'https://factpulse.fr').chomp('/')
|
|
138
|
+
@client_uid, @polling_interval, @polling_timeout, @max_retries = client_uid, polling_interval || 2000, polling_timeout || 120000, max_retries || 1
|
|
139
|
+
@chorus_credentials, @afnor_credentials = chorus_credentials, afnor_credentials
|
|
140
|
+
@access_token = @refresh_token = @token_expires_at = nil
|
|
141
|
+
end
|
|
169
142
|
|
|
170
|
-
|
|
171
|
-
|
|
143
|
+
def chorus_credentials_for_api; @chorus_credentials&.to_h; end
|
|
144
|
+
def afnor_credentials_for_api; @afnor_credentials&.to_h; end
|
|
145
|
+
# Alias plus courts
|
|
146
|
+
def get_chorus_pro_credentials; chorus_credentials_for_api; end
|
|
147
|
+
def get_afnor_credentials; afnor_credentials_for_api; end
|
|
148
|
+
|
|
149
|
+
def ensure_authenticated(force_refresh: false)
|
|
150
|
+
now = (Time.now.to_f * 1000).to_i
|
|
151
|
+
if force_refresh || @access_token.nil? || (@token_expires_at && now >= @token_expires_at)
|
|
152
|
+
payload = { 'username' => @email, 'password' => @password }; payload['client_uid'] = @client_uid if @client_uid
|
|
153
|
+
response = http_post(URI("#{@api_url}/api/token/"), payload)
|
|
154
|
+
raise FactPulseAuthError, "Auth failed" unless response.is_a?(Net::HTTPSuccess)
|
|
155
|
+
tokens = JSON.parse(response.body); @access_token, @refresh_token = tokens['access'], tokens['refresh']
|
|
156
|
+
@token_expires_at = now + (28 * 60 * 1000)
|
|
157
|
+
end
|
|
158
|
+
end
|
|
172
159
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
160
|
+
def reset_auth; @access_token = @refresh_token = @token_expires_at = nil; end
|
|
161
|
+
|
|
162
|
+
def poll_task(task_id, timeout: nil, interval: nil)
|
|
163
|
+
timeout_ms, interval_ms = timeout || @polling_timeout, interval || @polling_interval
|
|
164
|
+
start_time, current_interval = (Time.now.to_f * 1000).to_i, interval_ms.to_f
|
|
165
|
+
loop do
|
|
166
|
+
raise FactPulsePollingTimeout.new(task_id, timeout_ms) if (Time.now.to_f * 1000).to_i - start_time > timeout_ms
|
|
167
|
+
ensure_authenticated; response = http_get(URI("#{@api_url}/api/v1/traitement/taches/#{task_id}/statut"))
|
|
168
|
+
reset_auth and next if response.code == '401'
|
|
169
|
+
data = JSON.parse(response.body)
|
|
170
|
+
return data['resultat'] || {} if data['statut'] == 'SUCCESS'
|
|
171
|
+
if data['statut'] == 'FAILURE'
|
|
172
|
+
r = data['resultat'] || {}
|
|
173
|
+
raise FactPulseValidationError.new("Task #{task_id} failed: #{r['message_erreur'] || '?'}", (r['erreurs'] || []).map { |e| ValidationErrorDetail.from_hash(e) })
|
|
179
174
|
end
|
|
180
|
-
|
|
181
|
-
elsif data['detail'].is_a?(String)
|
|
182
|
-
msg = data['detail']
|
|
183
|
-
elsif data['errorMessage'].is_a?(String)
|
|
184
|
-
msg = data['errorMessage']
|
|
175
|
+
sleep(current_interval / 1000.0); current_interval = [current_interval * 1.5, 10000].min
|
|
185
176
|
end
|
|
186
177
|
end
|
|
187
178
|
|
|
188
|
-
|
|
189
|
-
|
|
179
|
+
def self.format_montant(m); MontantHelpers.montant(m); end
|
|
180
|
+
|
|
181
|
+
# Génère une facture Factur-X à partir d'un dict/hash et d'un PDF source.
|
|
182
|
+
# Accepte un Hash, un String JSON, ou tout objet avec une méthode to_h/to_hash.
|
|
183
|
+
# @param facture_data [Hash, String, Object] Données de la facture
|
|
184
|
+
# @param pdf_source [String, File] Chemin vers le PDF source ou objet File
|
|
185
|
+
# @param profil [String] Profil Factur-X (MINIMUM, BASIC, EN16931, EXTENDED)
|
|
186
|
+
# @param format_sortie [String] Format de sortie (pdf, xml, both)
|
|
187
|
+
# @param sync [Boolean] Mode synchrone (true) ou asynchrone (false)
|
|
188
|
+
# @param timeout [Integer, nil] Timeout en ms pour le polling
|
|
189
|
+
# @return [String] Contenu binaire du PDF généré
|
|
190
|
+
def generer_facturx(facture_data, pdf_source, profil: 'EN16931', format_sortie: 'pdf', sync: true, timeout: nil)
|
|
191
|
+
# Conversion des données en JSON string
|
|
192
|
+
json_data = case facture_data
|
|
193
|
+
when String then facture_data
|
|
194
|
+
when Hash then JSON.generate(facture_data)
|
|
195
|
+
else
|
|
196
|
+
if facture_data.respond_to?(:to_h)
|
|
197
|
+
JSON.generate(facture_data.to_h)
|
|
198
|
+
elsif facture_data.respond_to?(:to_hash)
|
|
199
|
+
JSON.generate(facture_data.to_hash)
|
|
200
|
+
else
|
|
201
|
+
raise FactPulseValidationError.new("Type de données non supporté: #{facture_data.class}")
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Lecture du PDF source
|
|
206
|
+
pdf_content = case pdf_source
|
|
207
|
+
when String then File.binread(pdf_source)
|
|
208
|
+
when File then pdf_source.read
|
|
209
|
+
else
|
|
210
|
+
if pdf_source.respond_to?(:read)
|
|
211
|
+
pdf_source.read
|
|
212
|
+
else
|
|
213
|
+
raise FactPulseValidationError.new("Type de PDF non supporté: #{pdf_source.class}")
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
pdf_filename = pdf_source.is_a?(String) ? File.basename(pdf_source) : 'facture.pdf'
|
|
217
|
+
|
|
218
|
+
ensure_authenticated
|
|
219
|
+
uri = URI("#{@api_url}/api/v1/traitement/generer-facture")
|
|
220
|
+
|
|
221
|
+
# Construire la requête multipart
|
|
222
|
+
boundary = "----RubyFormBoundary#{SecureRandom.hex(16)}"
|
|
223
|
+
body = []
|
|
224
|
+
|
|
225
|
+
# Champ donnees_facture
|
|
226
|
+
body << "--#{boundary}\r\n"
|
|
227
|
+
body << "Content-Disposition: form-data; name=\"donnees_facture\"\r\n\r\n"
|
|
228
|
+
body << "#{json_data}\r\n"
|
|
229
|
+
|
|
230
|
+
# Champ profil
|
|
231
|
+
body << "--#{boundary}\r\n"
|
|
232
|
+
body << "Content-Disposition: form-data; name=\"profil\"\r\n\r\n"
|
|
233
|
+
body << "#{profil}\r\n"
|
|
190
234
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
235
|
+
# Champ format_sortie
|
|
236
|
+
body << "--#{boundary}\r\n"
|
|
237
|
+
body << "Content-Disposition: form-data; name=\"format_sortie\"\r\n\r\n"
|
|
238
|
+
body << "#{format_sortie}\r\n"
|
|
194
239
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
240
|
+
# Champ source_pdf (fichier)
|
|
241
|
+
body << "--#{boundary}\r\n"
|
|
242
|
+
body << "Content-Disposition: form-data; name=\"source_pdf\"; filename=\"#{pdf_filename}\"\r\n"
|
|
243
|
+
body << "Content-Type: application/pdf\r\n\r\n"
|
|
244
|
+
body << pdf_content
|
|
245
|
+
body << "\r\n"
|
|
246
|
+
|
|
247
|
+
body << "--#{boundary}--\r\n"
|
|
248
|
+
body_str = body.join
|
|
200
249
|
|
|
201
|
-
ensure_auth
|
|
202
|
-
uri = URI("#{@api_url}/api/v1/processing/tasks/#{task_id}/status")
|
|
203
250
|
http = Net::HTTP.new(uri.host, uri.port)
|
|
204
251
|
http.use_ssl = uri.scheme == 'https'
|
|
205
|
-
http.read_timeout =
|
|
206
|
-
|
|
207
|
-
req = Net::HTTP::Get.new(uri)
|
|
208
|
-
req['Authorization'] = "Bearer #{@token}"
|
|
209
|
-
response = http.request(req)
|
|
252
|
+
http.read_timeout = 120
|
|
210
253
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
254
|
+
request = Net::HTTP::Post.new(uri)
|
|
255
|
+
request['Authorization'] = "Bearer #{@access_token}"
|
|
256
|
+
request['Content-Type'] = "multipart/form-data; boundary=#{boundary}"
|
|
257
|
+
request.body = body_str
|
|
215
258
|
|
|
216
|
-
|
|
217
|
-
status = data['status']
|
|
259
|
+
response = http.request(request)
|
|
218
260
|
|
|
219
|
-
if
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
return result
|
|
261
|
+
if response.code == '401'
|
|
262
|
+
reset_auth
|
|
263
|
+
ensure_authenticated
|
|
264
|
+
request['Authorization'] = "Bearer #{@access_token}"
|
|
265
|
+
response = http.request(request)
|
|
225
266
|
end
|
|
226
267
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
raise
|
|
268
|
+
unless response.is_a?(Net::HTTPSuccess)
|
|
269
|
+
error_data = JSON.parse(response.body) rescue { 'detail' => response.body }
|
|
270
|
+
raise FactPulseValidationError.new("Erreur API: #{error_data['detail'] || response.body}")
|
|
230
271
|
end
|
|
231
272
|
|
|
232
|
-
|
|
233
|
-
interval = [interval * 1.5, 10].min
|
|
234
|
-
end
|
|
235
|
-
end
|
|
273
|
+
data = JSON.parse(response.body)
|
|
236
274
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
275
|
+
if sync && data['id_tache']
|
|
276
|
+
result = poll_task(data['id_tache'], timeout: timeout)
|
|
277
|
+
if result['contenu_b64']
|
|
278
|
+
require 'base64'
|
|
279
|
+
return Base64.decode64(result['contenu_b64'])
|
|
280
|
+
elsif result['contenu_xml']
|
|
281
|
+
return result['contenu_xml']
|
|
282
|
+
end
|
|
283
|
+
raise FactPulseValidationError.new("Résultat inattendu: #{result.keys.join(', ')}")
|
|
241
284
|
end
|
|
242
|
-
end
|
|
243
|
-
end
|
|
244
|
-
|
|
245
|
-
def refresh_token
|
|
246
|
-
uri = URI("#{@api_url}/api/token/")
|
|
247
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
|
248
|
-
http.use_ssl = uri.scheme == 'https'
|
|
249
|
-
http.read_timeout = @timeout
|
|
250
|
-
|
|
251
|
-
req = Net::HTTP::Post.new(uri)
|
|
252
|
-
req['Content-Type'] = 'application/json'
|
|
253
|
-
req.body = JSON.generate(username: @email, password: @password, client_uid: @client_uid)
|
|
254
|
-
|
|
255
|
-
response = http.request(req)
|
|
256
285
|
|
|
257
|
-
|
|
258
|
-
raise Error.new("Authentication failed: HTTP #{response.code}", status_code: response.code.to_i)
|
|
286
|
+
data
|
|
259
287
|
end
|
|
260
288
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
289
|
+
private
|
|
290
|
+
def http_post(uri, payload)
|
|
291
|
+
Net::HTTP.new(uri.host, uri.port).tap { |h| h.use_ssl = uri.scheme == 'https'; h.read_timeout = 30 }
|
|
292
|
+
.request(Net::HTTP::Post.new(uri).tap { |r| r['Content-Type'] = 'application/json'; r.body = JSON.generate(payload) })
|
|
293
|
+
end
|
|
294
|
+
def http_get(uri)
|
|
295
|
+
Net::HTTP.new(uri.host, uri.port).tap { |h| h.use_ssl = uri.scheme == 'https'; h.read_timeout = 30 }
|
|
296
|
+
.request(Net::HTTP::Get.new(uri).tap { |r| r['Authorization'] = "Bearer #{@access_token}" })
|
|
269
297
|
end
|
|
270
298
|
end
|
|
271
299
|
end
|
|
@@ -1,45 +1,21 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
3
2
|
module FactPulse
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def initialize(task_id, timeout)
|
|
11
|
-
@task_id = task_id
|
|
12
|
-
@timeout = timeout
|
|
13
|
-
super("Timeout (#{timeout}ms) for #{task_id}")
|
|
3
|
+
module Helpers
|
|
4
|
+
class FactPulseError < StandardError; end
|
|
5
|
+
class FactPulseAuthError < FactPulseError; end
|
|
6
|
+
class FactPulsePollingTimeout < FactPulseError
|
|
7
|
+
attr_reader :task_id, :timeout
|
|
8
|
+
def initialize(task_id, timeout); @task_id, @timeout = task_id, timeout; super("Timeout (#{timeout}ms) pour #{task_id}"); end
|
|
14
9
|
end
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def initialize(level: '', item: '', reason: '', source: nil, code: nil)
|
|
21
|
-
@level = level
|
|
22
|
-
@item = item
|
|
23
|
-
@reason = reason
|
|
24
|
-
@source = source
|
|
25
|
-
@code = code
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def to_s
|
|
29
|
-
"[#{@item.to_s.empty? ? 'unknown' : @item}] #{@reason.to_s.empty? ? 'Unknown error' : @reason}"
|
|
10
|
+
class ValidationErrorDetail
|
|
11
|
+
attr_accessor :level, :item, :reason, :source, :code
|
|
12
|
+
def initialize(level: '', item: '', reason: '', source: nil, code: nil); @level, @item, @reason, @source, @code = level, item, reason, source, code; end
|
|
13
|
+
def to_s; "[#{@item.to_s.empty? ? 'unknown' : @item}] #{@reason.to_s.empty? ? 'Unknown error' : @reason}"; end
|
|
14
|
+
def self.from_hash(h); new(level: h['level']||'', item: h['item']||'', reason: h['reason']||'', source: h['source'], code: h['code']); end
|
|
30
15
|
end
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
class ValidationError < Error
|
|
38
|
-
attr_reader :errors
|
|
39
|
-
|
|
40
|
-
def initialize(msg, errors = [])
|
|
41
|
-
@errors = errors
|
|
42
|
-
super(errors.empty? ? msg : "#{msg}\n\nDetails:\n#{errors.map { |e| " - #{e}" }.join("\n")}")
|
|
16
|
+
class FactPulseValidationError < FactPulseError
|
|
17
|
+
attr_reader :errors
|
|
18
|
+
def initialize(msg, errors = []); @errors = errors; super(errors.empty? ? msg : "#{msg}\n\nDétails:\n#{errors.map{|e| " - #{e}"}.join("\n")}"); end
|
|
43
19
|
end
|
|
44
20
|
end
|
|
45
21
|
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require_relative 'helpers/exceptions'
|
|
3
|
+
require_relative 'helpers/client'
|
|
4
|
+
module FactPulse
|
|
5
|
+
module Helpers
|
|
6
|
+
def self.create_client(**opts); FactPulseClient.new(**opts); end
|
|
7
|
+
def self.format_montant(m); MontantHelpers.montant(m); end
|
|
8
|
+
def self.montant(m); MontantHelpers.montant(m); end
|
|
9
|
+
def self.montant_total(*args, **kwargs); MontantHelpers.montant_total(*args, **kwargs); end
|
|
10
|
+
def self.ligne_de_poste(*args, **kwargs); MontantHelpers.ligne_de_poste(*args, **kwargs); end
|
|
11
|
+
def self.ligne_de_tva(*args, **kwargs); MontantHelpers.ligne_de_tva(*args, **kwargs); end
|
|
12
|
+
end
|
|
13
|
+
end
|