factpulse 2.0.42 → 3.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 +3 -3
- data/Gemfile.lock +3 -3
- data/README.md +91 -91
- data/docs/{CredentialsAFNOR.md → AFNORCredentials.md} +2 -2
- data/docs/{DestinationAFNOR.md → AFNORDestination.md} +4 -4
- data/docs/AFNORHealthCheckResponse.md +22 -0
- data/docs/AFNORPDPPAApi.md +25 -25
- data/docs/AFNORPDPPADirectoryServiceApi.md +19 -19
- data/docs/AFNORPDPPAFlowServiceApi.md +16 -16
- data/docs/{ResultatAFNOR.md → AFNORResult.md} +5 -5
- data/docs/APIError.md +2 -2
- data/docs/{MontantTva.md → APIProfile.md} +2 -2
- data/docs/{CodeCadreFacturation.md → AcknowledgmentStatus.md} +2 -2
- data/docs/{CodeRaisonReduction.md → AllowanceReasonCode.md} +2 -2
- data/docs/{ModeDepot.md → AmountDue.md} +2 -2
- data/docs/BoundingBoxSchema.md +7 -7
- data/docs/{CategorieTVA.md → CeleryStatus.md} +2 -2
- data/docs/CertificateInfoResponse.md +20 -20
- data/docs/ChorusProApi.md +123 -123
- data/docs/ChorusProDestination.md +20 -0
- data/docs/ChorusProResult.md +22 -0
- data/docs/Destination.md +7 -7
- data/docs/{ModePaiement.md → DocumentType.md} +2 -2
- data/docs/{AdresseElectronique.md → ElectronicAddress.md} +4 -4
- data/docs/EnrichedInvoiceInfo.md +32 -0
- data/docs/FacturXPDFInfo.md +22 -0
- data/docs/FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md +26 -0
- data/docs/{CredentialsChorusPro.md → FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md} +4 -4
- data/docs/FactureFacturX.md +30 -30
- data/docs/FieldStatus.md +15 -0
- data/docs/{DirectionFlux.md → FlowDirection.md} +2 -2
- data/docs/FlowProfile.md +15 -0
- data/docs/FlowSummary.md +32 -0
- data/docs/{ProfilFlux.md → FlowSyntax.md} +2 -2
- data/docs/{TypeTVA.md → FlowType.md} +2 -2
- data/docs/GenerateCertificateRequest.md +19 -19
- data/docs/GenerateCertificateResponse.md +8 -8
- data/docs/GetChorusProIdRequest.md +22 -0
- data/docs/GetChorusProIdResponse.md +24 -0
- data/docs/GetInvoiceRequest.md +20 -0
- data/docs/GetInvoiceResponse.md +34 -0
- data/docs/GetStructureRequest.md +22 -0
- data/docs/GetStructureResponse.md +34 -0
- data/docs/GlobalAllowanceAmount.md +15 -0
- data/docs/{SantApi.md → HealthApi.md} +23 -23
- data/docs/IncomingInvoice.md +54 -0
- data/docs/IncomingSupplier.md +32 -0
- data/docs/{FormatFacture.md → InvoiceFormat.md} +2 -2
- data/docs/InvoiceLine.md +46 -0
- data/docs/InvoiceLineAllowanceAmount.md +15 -0
- data/docs/InvoiceNote.md +20 -0
- data/docs/InvoiceProcessingApi.md +831 -0
- data/docs/InvoiceReferences.md +32 -0
- data/docs/{StatutFacture.md → InvoiceStatus.md} +5 -5
- data/docs/InvoiceTotals.md +30 -0
- data/docs/InvoiceTotalsPrepayment.md +15 -0
- data/docs/InvoiceTypeCode.md +15 -0
- data/docs/InvoicingFramework.md +24 -0
- data/docs/InvoicingFrameworkCode.md +15 -0
- data/docs/LineNetAmount.md +15 -0
- data/docs/MandatoryNoteSchema.md +30 -0
- data/docs/ManualRate.md +15 -0
- data/docs/ManualVatRate.md +15 -0
- data/docs/OperationNature.md +15 -0
- data/docs/{FormatSortie.md → OutputFormat.md} +2 -2
- data/docs/PDFValidationResultAPI.md +62 -0
- data/docs/PDFXMLVerificationApi.md +435 -0
- data/docs/PDPCredentials.md +4 -4
- data/docs/PageDimensionsSchema.md +20 -0
- data/docs/{Beneficiaire.md → Payee.md} +5 -5
- data/docs/PaymentMeans.md +15 -0
- data/docs/PostalAddress.md +26 -0
- data/docs/ProcessingOptions.md +24 -0
- data/docs/{Quantite.md → Quantity.md} +2 -2
- data/docs/Recipient.md +28 -0
- data/docs/SearchFlowRequest.md +34 -0
- data/docs/SearchFlowResponse.md +24 -0
- data/docs/SearchServicesResponse.md +24 -0
- data/docs/SearchStructureRequest.md +26 -0
- data/docs/SearchStructureResponse.md +24 -0
- data/docs/SignatureInfo.md +2 -2
- data/docs/SignatureInfoAPI.md +28 -0
- data/docs/SignatureParameters.md +34 -0
- data/docs/SimplifiedInvoiceData.md +34 -0
- data/docs/StructureInfo.md +10 -10
- data/docs/StructureParameters.md +22 -0
- data/docs/StructureService.md +24 -0
- data/docs/SubmissionMode.md +15 -0
- data/docs/SubmitCompleteInvoiceRequest.md +26 -0
- data/docs/SubmitCompleteInvoiceResponse.md +34 -0
- data/docs/SubmitFlowRequest.md +28 -0
- data/docs/SubmitFlowResponse.md +30 -0
- data/docs/SubmitInvoiceRequest.md +46 -0
- data/docs/SubmitInvoiceResponse.md +24 -0
- data/docs/SupplementaryAttachment.md +26 -0
- data/docs/Supplier.md +36 -0
- data/docs/TaskResponse.md +18 -0
- data/docs/TaskStatus.md +22 -0
- data/docs/TaxableAmount.md +15 -0
- data/docs/TotalGrossAmount.md +15 -0
- data/docs/TotalNetAmount.md +15 -0
- data/docs/TotalVATAmount.md +15 -0
- data/docs/UnitNetPrice.md +15 -0
- data/docs/UnitOfMeasure.md +15 -0
- data/docs/UserApi.md +74 -0
- data/docs/VATAccountingCode.md +15 -0
- data/docs/{ProfilAPI.md → VATAmount.md} +2 -2
- data/docs/VATCategory.md +15 -0
- data/docs/VATLine.md +30 -0
- data/docs/ValidationErrorDetail.md +3 -3
- data/docs/ValidationErrorResponse.md +18 -0
- data/docs/ValidationSuccessResponse.md +18 -0
- data/docs/{TypeFlux.md → VatAmount.md} +2 -2
- data/docs/VerificationSuccessResponse.md +36 -0
- data/docs/VerifiedFieldSchema.md +34 -0
- data/factpulse.gemspec +4 -4
- data/lib/factpulse/api/afnorpdppa_api.rb +25 -25
- data/lib/factpulse/api/afnorpdppa_directory_service_api.rb +40 -40
- data/lib/factpulse/api/afnorpdppa_flow_service_api.rb +16 -16
- data/lib/factpulse/api/chorus_pro_api.rb +127 -127
- data/lib/factpulse/api/health_api.rb +136 -0
- data/lib/factpulse/api/invoice_processing_api.rb +835 -0
- data/lib/factpulse/api/pdfxml_verification_api.rb +430 -0
- data/lib/factpulse/api/user_api.rb +79 -0
- data/lib/factpulse/api_client.rb +2 -2
- data/lib/factpulse/api_error.rb +2 -2
- data/lib/factpulse/api_model_base.rb +2 -2
- data/lib/factpulse/configuration.rb +2 -2
- data/lib/factpulse/helpers/client.rb +182 -182
- data/lib/factpulse/helpers/exceptions.rb +2 -2
- data/lib/factpulse/helpers/helpers.rb +5 -5
- data/lib/factpulse/models/acknowledgment_status.rb +41 -0
- data/lib/factpulse/models/afnor_credentials.rb +169 -0
- data/lib/factpulse/models/{destination_afnor.rb → afnor_destination.rb} +10 -10
- data/lib/factpulse/models/{reponse_healthcheck_afnor.rb → afnor_health_check_response.rb} +9 -9
- data/lib/factpulse/models/{resultat_afnor.rb → afnor_result.rb} +13 -13
- data/lib/factpulse/models/allowance_reason_code.rb +45 -0
- data/lib/factpulse/models/amount_due.rb +104 -0
- data/lib/factpulse/models/api_error.rb +5 -5
- data/lib/factpulse/models/api_profile.rb +42 -0
- data/lib/factpulse/models/bounding_box_schema.rb +10 -10
- data/lib/factpulse/models/celery_status.rb +43 -0
- data/lib/factpulse/models/certificate_info_response.rb +164 -164
- data/lib/factpulse/models/{destination_chorus_pro.rb → chorus_pro_destination.rb} +7 -7
- data/lib/factpulse/models/chorus_pro_result.rb +186 -0
- data/lib/factpulse/models/destination.rb +7 -7
- data/lib/factpulse/models/document_type.rb +43 -0
- data/lib/factpulse/models/electronic_address.rb +196 -0
- data/lib/factpulse/models/enriched_invoice_info.rb +348 -0
- data/lib/factpulse/models/error_level.rb +2 -2
- data/lib/factpulse/models/error_source.rb +2 -2
- data/lib/factpulse/models/factur_xpdf_info.rb +205 -0
- data/lib/factpulse/models/{chorus_pro_credentials.rb → facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.rb} +11 -11
- data/lib/factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb +191 -0
- data/lib/factpulse/models/facture_factur_x.rb +160 -160
- data/lib/factpulse/models/field_status.rb +43 -0
- data/lib/factpulse/models/flow_direction.rb +40 -0
- data/lib/factpulse/models/flow_profile.rb +41 -0
- data/lib/factpulse/models/flow_summary.rb +251 -0
- data/lib/factpulse/models/flow_syntax.rb +43 -0
- data/lib/factpulse/models/flow_type.rb +43 -0
- data/lib/factpulse/models/generate_certificate_request.rb +106 -106
- data/lib/factpulse/models/generate_certificate_response.rb +47 -47
- data/lib/factpulse/models/get_chorus_pro_id_request.rb +188 -0
- data/lib/factpulse/models/get_chorus_pro_id_response.rb +230 -0
- data/lib/factpulse/models/get_invoice_request.rb +176 -0
- data/lib/factpulse/models/get_invoice_response.rb +261 -0
- data/lib/factpulse/models/get_structure_request.rb +188 -0
- data/lib/factpulse/models/get_structure_response.rb +261 -0
- data/lib/factpulse/models/global_allowance_amount.rb +104 -0
- data/lib/factpulse/models/http_validation_error.rb +2 -2
- data/lib/factpulse/models/incoming_invoice.rb +522 -0
- data/lib/factpulse/models/incoming_supplier.rb +236 -0
- data/lib/factpulse/models/invoice_format.rb +41 -0
- data/lib/factpulse/models/invoice_line.rb +389 -0
- data/lib/factpulse/models/invoice_line_allowance_amount.rb +104 -0
- data/lib/factpulse/models/invoice_note.rb +175 -0
- data/lib/factpulse/models/invoice_references.rb +290 -0
- data/lib/factpulse/models/invoice_status.rb +203 -0
- data/lib/factpulse/models/invoice_totals.rb +272 -0
- data/lib/factpulse/models/invoice_totals_prepayment.rb +104 -0
- data/lib/factpulse/models/invoice_type_code.rb +70 -0
- data/lib/factpulse/models/invoicing_framework.rb +217 -0
- data/lib/factpulse/models/invoicing_framework_code.rb +46 -0
- data/lib/factpulse/models/line_net_amount.rb +104 -0
- data/lib/factpulse/models/mandatory_note_schema.rb +265 -0
- data/lib/factpulse/models/manual_rate.rb +104 -0
- data/lib/factpulse/models/manual_vat_rate.rb +104 -0
- data/lib/factpulse/models/operation_nature.rb +52 -0
- data/lib/factpulse/models/output_format.rb +40 -0
- data/lib/factpulse/models/page_dimensions_schema.rb +193 -0
- data/lib/factpulse/models/{beneficiaire.rb → payee.rb} +15 -15
- data/lib/factpulse/models/payment_means.rb +50 -0
- data/lib/factpulse/models/pdf_validation_result_api.rb +523 -0
- data/lib/factpulse/models/pdp_credentials.rb +7 -7
- data/lib/factpulse/models/postal_address.rb +189 -0
- data/lib/factpulse/models/processing_options.rb +207 -0
- data/lib/factpulse/models/quantity.rb +104 -0
- data/lib/factpulse/models/recipient.rb +201 -0
- data/lib/factpulse/models/scheme_id.rb +2 -2
- data/lib/factpulse/models/search_flow_request.rb +306 -0
- data/lib/factpulse/models/search_flow_response.rb +249 -0
- data/lib/factpulse/models/search_services_response.rb +214 -0
- data/lib/factpulse/models/search_structure_request.rb +191 -0
- data/lib/factpulse/models/search_structure_response.rb +216 -0
- data/lib/factpulse/models/signature_info.rb +20 -20
- data/lib/factpulse/models/signature_info_api.rb +216 -0
- data/lib/factpulse/models/signature_parameters.rb +235 -0
- data/lib/factpulse/models/simplified_invoice_data.rb +342 -0
- data/lib/factpulse/models/structure_info.rb +84 -84
- data/lib/factpulse/models/structure_parameters.rb +175 -0
- data/lib/factpulse/models/structure_service.rb +247 -0
- data/lib/factpulse/models/submission_mode.rb +44 -0
- data/lib/factpulse/models/submit_complete_invoice_request.rb +239 -0
- data/lib/factpulse/models/submit_complete_invoice_response.rb +355 -0
- data/lib/factpulse/models/submit_flow_request.rb +238 -0
- data/lib/factpulse/models/submit_flow_response.rb +294 -0
- data/lib/factpulse/models/submit_invoice_request.rb +388 -0
- data/lib/factpulse/models/submit_invoice_response.rb +213 -0
- data/lib/factpulse/models/supplementary_attachment.rb +269 -0
- data/lib/factpulse/models/supplier.rb +257 -0
- data/lib/factpulse/models/task_response.rb +166 -0
- data/lib/factpulse/models/task_status.rb +227 -0
- data/lib/factpulse/models/taxable_amount.rb +104 -0
- data/lib/factpulse/models/total_gross_amount.rb +104 -0
- data/lib/factpulse/models/total_net_amount.rb +104 -0
- data/lib/factpulse/models/total_vat_amount.rb +104 -0
- data/lib/factpulse/models/unit_net_price.rb +104 -0
- data/lib/factpulse/models/unit_of_measure.rb +50 -0
- data/lib/factpulse/models/validation_error.rb +2 -2
- data/lib/factpulse/models/validation_error_detail.rb +6 -6
- data/lib/factpulse/models/validation_error_loc_inner.rb +2 -2
- data/lib/factpulse/models/validation_error_response.rb +168 -0
- data/lib/factpulse/models/validation_success_response.rb +166 -0
- data/lib/factpulse/models/vat_accounting_code.rb +46 -0
- data/lib/factpulse/models/vat_amount.rb +104 -0
- data/lib/factpulse/models/vat_category.rb +47 -0
- data/lib/factpulse/models/vat_line.rb +262 -0
- data/lib/factpulse/models/verification_success_response.rb +343 -0
- data/lib/factpulse/models/verified_field_schema.rb +334 -0
- data/lib/factpulse/version.rb +3 -3
- data/lib/factpulse.rb +99 -99
- metadata +250 -257
- data/docs/AdressePostale.md +0 -26
- data/docs/CadreDeFacturation.md +0 -24
- data/docs/ChampVerifieSchema.md +0 -34
- data/docs/ChorusProCredentials.md +0 -26
- data/docs/ConsulterFactureRequest.md +0 -20
- data/docs/ConsulterFactureResponse.md +0 -34
- data/docs/ConsulterStructureRequest.md +0 -22
- data/docs/ConsulterStructureResponse.md +0 -34
- data/docs/Destinataire.md +0 -28
- data/docs/DestinationChorusPro.md +0 -20
- data/docs/DimensionPageSchema.md +0 -20
- data/docs/DonneesFactureSimplifiees.md +0 -34
- data/docs/FactureEnrichieInfo.md +0 -32
- data/docs/FactureEntrante.md +0 -54
- data/docs/FluxResume.md +0 -32
- data/docs/Fournisseur.md +0 -36
- data/docs/FournisseurEntrant.md +0 -32
- data/docs/InformationSignatureAPI.md +0 -28
- data/docs/LigneDePoste.md +0 -46
- data/docs/LigneDePosteMontantRemiseHt.md +0 -15
- data/docs/LigneDePosteTauxTvaManuel.md +0 -15
- data/docs/LigneDeTVA.md +0 -30
- data/docs/MontantAPayer.md +0 -15
- data/docs/MontantBaseHt.md +0 -15
- data/docs/MontantHtTotal.md +0 -15
- data/docs/MontantRemiseGlobaleTtc.md +0 -15
- data/docs/MontantTotal.md +0 -30
- data/docs/MontantTotalAcompte.md +0 -15
- data/docs/MontantTotalLigneHt.md +0 -15
- data/docs/MontantTtcTotal.md +0 -15
- data/docs/MontantTvaLigne.md +0 -15
- data/docs/MontantTvaTotal.md +0 -15
- data/docs/MontantUnitaireHt.md +0 -15
- data/docs/NatureOperation.md +0 -15
- data/docs/Note.md +0 -20
- data/docs/NoteObligatoireSchema.md +0 -30
- data/docs/ObtenirIdChorusProRequest.md +0 -22
- data/docs/ObtenirIdChorusProResponse.md +0 -24
- data/docs/OptionsProcessing.md +0 -24
- data/docs/PDFFacturXInfo.md +0 -22
- data/docs/ParametresSignature.md +0 -34
- data/docs/ParametresStructure.md +0 -22
- data/docs/PieceJointeComplementaire.md +0 -26
- data/docs/RechercherServicesResponse.md +0 -24
- data/docs/RechercherStructureRequest.md +0 -26
- data/docs/RechercherStructureResponse.md +0 -24
- data/docs/References.md +0 -32
- data/docs/ReponseHealthcheckAFNOR.md +0 -22
- data/docs/ReponseRechercheFlux.md +0 -24
- data/docs/ReponseSoumissionFlux.md +0 -30
- data/docs/ReponseTache.md +0 -18
- data/docs/ReponseValidationErreur.md +0 -18
- data/docs/ReponseValidationSucces.md +0 -18
- data/docs/ReponseVerificationSucces.md +0 -36
- data/docs/RequeteRechercheFlux.md +0 -34
- data/docs/RequeteSoumissionFlux.md +0 -28
- data/docs/ResultatChorusPro.md +0 -22
- data/docs/ResultatValidationPDFAPI.md +0 -62
- data/docs/ServiceStructure.md +0 -24
- data/docs/SoumettreFactureCompleteRequest.md +0 -26
- data/docs/SoumettreFactureCompleteResponse.md +0 -34
- data/docs/SoumettreFactureRequest.md +0 -46
- data/docs/SoumettreFactureResponse.md +0 -24
- data/docs/StatutAcquittement.md +0 -15
- data/docs/StatutCelery.md +0 -15
- data/docs/StatutChampAPI.md +0 -15
- data/docs/StatutTache.md +0 -22
- data/docs/SyntaxeFlux.md +0 -15
- data/docs/Tauxmanuel.md +0 -15
- data/docs/TraitementFactureApi.md +0 -831
- data/docs/TypeDocument.md +0 -15
- data/docs/TypeFacture.md +0 -15
- data/docs/Unite.md +0 -15
- data/docs/UtilisateurApi.md +0 -74
- data/docs/VrificationPDFXMLApi.md +0 -435
- data/lib/factpulse/api/sant_api.rb +0 -136
- data/lib/factpulse/api/traitement_facture_api.rb +0 -835
- data/lib/factpulse/api/utilisateur_api.rb +0 -79
- data/lib/factpulse/api/vrification_pdfxml_api.rb +0 -430
- data/lib/factpulse/models/adresse_electronique.rb +0 -196
- data/lib/factpulse/models/adresse_postale.rb +0 -189
- data/lib/factpulse/models/cadre_de_facturation.rb +0 -217
- data/lib/factpulse/models/categorie_tva.rb +0 -47
- data/lib/factpulse/models/champ_verifie_schema.rb +0 -334
- data/lib/factpulse/models/code_cadre_facturation.rb +0 -42
- data/lib/factpulse/models/code_raison_reduction.rb +0 -45
- data/lib/factpulse/models/consulter_facture_request.rb +0 -176
- data/lib/factpulse/models/consulter_facture_response.rb +0 -261
- data/lib/factpulse/models/consulter_structure_request.rb +0 -188
- data/lib/factpulse/models/consulter_structure_response.rb +0 -261
- data/lib/factpulse/models/credentials_afnor.rb +0 -169
- data/lib/factpulse/models/credentials_chorus_pro.rb +0 -191
- data/lib/factpulse/models/destinataire.rb +0 -201
- data/lib/factpulse/models/dimension_page_schema.rb +0 -193
- data/lib/factpulse/models/direction_flux.rb +0 -40
- data/lib/factpulse/models/donnees_facture_simplifiees.rb +0 -342
- data/lib/factpulse/models/facture_enrichie_info.rb +0 -348
- data/lib/factpulse/models/facture_entrante.rb +0 -522
- data/lib/factpulse/models/flux_resume.rb +0 -251
- data/lib/factpulse/models/format_facture.rb +0 -41
- data/lib/factpulse/models/format_sortie.rb +0 -40
- data/lib/factpulse/models/fournisseur.rb +0 -257
- data/lib/factpulse/models/fournisseur_entrant.rb +0 -236
- data/lib/factpulse/models/information_signature_api.rb +0 -216
- data/lib/factpulse/models/ligne_de_poste.rb +0 -390
- data/lib/factpulse/models/ligne_de_poste_montant_remise_ht.rb +0 -104
- data/lib/factpulse/models/ligne_de_poste_taux_tva_manuel.rb +0 -104
- data/lib/factpulse/models/ligne_de_tva.rb +0 -262
- data/lib/factpulse/models/mode_depot.rb +0 -41
- data/lib/factpulse/models/mode_paiement.rb +0 -44
- data/lib/factpulse/models/montant_a_payer.rb +0 -104
- data/lib/factpulse/models/montant_base_ht.rb +0 -104
- data/lib/factpulse/models/montant_ht_total.rb +0 -104
- data/lib/factpulse/models/montant_remise_globale_ttc.rb +0 -104
- data/lib/factpulse/models/montant_total.rb +0 -272
- data/lib/factpulse/models/montant_total_acompte.rb +0 -104
- data/lib/factpulse/models/montant_total_ligne_ht.rb +0 -104
- data/lib/factpulse/models/montant_ttc_total.rb +0 -104
- data/lib/factpulse/models/montant_tva.rb +0 -104
- data/lib/factpulse/models/montant_tva_ligne.rb +0 -104
- data/lib/factpulse/models/montant_tva_total.rb +0 -104
- data/lib/factpulse/models/montant_unitaire_ht.rb +0 -104
- data/lib/factpulse/models/nature_operation.rb +0 -52
- data/lib/factpulse/models/note.rb +0 -175
- data/lib/factpulse/models/note_obligatoire_schema.rb +0 -265
- data/lib/factpulse/models/obtenir_id_chorus_pro_request.rb +0 -188
- data/lib/factpulse/models/obtenir_id_chorus_pro_response.rb +0 -230
- data/lib/factpulse/models/options_processing.rb +0 -207
- data/lib/factpulse/models/parametres_signature.rb +0 -235
- data/lib/factpulse/models/parametres_structure.rb +0 -175
- data/lib/factpulse/models/pdf_factur_x_info.rb +0 -205
- data/lib/factpulse/models/piece_jointe_complementaire.rb +0 -269
- data/lib/factpulse/models/profil_api.rb +0 -42
- data/lib/factpulse/models/profil_flux.rb +0 -41
- data/lib/factpulse/models/quantite.rb +0 -104
- data/lib/factpulse/models/rechercher_services_response.rb +0 -214
- data/lib/factpulse/models/rechercher_structure_request.rb +0 -191
- data/lib/factpulse/models/rechercher_structure_response.rb +0 -216
- data/lib/factpulse/models/references.rb +0 -290
- data/lib/factpulse/models/reponse_recherche_flux.rb +0 -249
- data/lib/factpulse/models/reponse_soumission_flux.rb +0 -294
- data/lib/factpulse/models/reponse_tache.rb +0 -165
- data/lib/factpulse/models/reponse_validation_erreur.rb +0 -167
- data/lib/factpulse/models/reponse_validation_succes.rb +0 -165
- data/lib/factpulse/models/reponse_verification_succes.rb +0 -343
- data/lib/factpulse/models/requete_recherche_flux.rb +0 -306
- data/lib/factpulse/models/requete_soumission_flux.rb +0 -238
- data/lib/factpulse/models/resultat_chorus_pro.rb +0 -186
- data/lib/factpulse/models/resultat_validation_pdfapi.rb +0 -523
- data/lib/factpulse/models/service_structure.rb +0 -247
- data/lib/factpulse/models/soumettre_facture_complete_request.rb +0 -239
- data/lib/factpulse/models/soumettre_facture_complete_response.rb +0 -355
- data/lib/factpulse/models/soumettre_facture_request.rb +0 -388
- data/lib/factpulse/models/soumettre_facture_response.rb +0 -213
- data/lib/factpulse/models/statut_acquittement.rb +0 -41
- data/lib/factpulse/models/statut_celery.rb +0 -43
- data/lib/factpulse/models/statut_champ_api.rb +0 -43
- data/lib/factpulse/models/statut_facture.rb +0 -203
- data/lib/factpulse/models/statut_tache.rb +0 -226
- data/lib/factpulse/models/syntaxe_flux.rb +0 -43
- data/lib/factpulse/models/tauxmanuel.rb +0 -104
- data/lib/factpulse/models/type_document.rb +0 -43
- data/lib/factpulse/models/type_facture.rb +0 -54
- data/lib/factpulse/models/type_flux.rb +0 -43
- data/lib/factpulse/models/type_tva.rb +0 -42
- data/lib/factpulse/models/unite.rb +0 -44
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#FactPulse REST API
|
|
3
|
+
|
|
4
|
+
# REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF 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 - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 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://www.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://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.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://www.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://www.factpulse.fr/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://www.factpulse.fr/documentation-api/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.18.0-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module FactPulse
|
|
17
|
+
# Optional parameters to sign the generated PDF. **MODE 1 - Stored certificate (recommended):** Only provide metadata (reason, location, etc.). The certificate will be automatically retrieved via client_uid from JWT. eIDAS compliant PAdES-B-LT signature. **MODE 2 - Keys in payload (tests/special cases):** Provide key_pem + cert_pem directly in the payload. Accepted PEM format: raw (\"-----BEGIN...\") or base64. **Selection rule:** - If key_pem AND cert_pem provided → Mode 2 (payload keys) - Otherwise → Mode 1 (stored certificate retrieved via client_uid)
|
|
18
|
+
class SignatureParameters < ApiModelBase
|
|
19
|
+
attr_accessor :key_pem
|
|
20
|
+
|
|
21
|
+
attr_accessor :cert_pem
|
|
22
|
+
|
|
23
|
+
attr_accessor :key_passphrase
|
|
24
|
+
|
|
25
|
+
attr_accessor :reason
|
|
26
|
+
|
|
27
|
+
attr_accessor :location
|
|
28
|
+
|
|
29
|
+
attr_accessor :contact
|
|
30
|
+
|
|
31
|
+
# PDF signature field name
|
|
32
|
+
attr_accessor :field_name
|
|
33
|
+
|
|
34
|
+
# Enable PAdES-B-LT (long-term archival). REQUIRES certificate with OCSP/CRL access
|
|
35
|
+
attr_accessor :use_pades_lt
|
|
36
|
+
|
|
37
|
+
# Enable RFC 3161 timestamping with FreeTSA (PAdES-B-T)
|
|
38
|
+
attr_accessor :use_timestamp
|
|
39
|
+
|
|
40
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
41
|
+
def self.attribute_map
|
|
42
|
+
{
|
|
43
|
+
:'key_pem' => :'keyPem',
|
|
44
|
+
:'cert_pem' => :'certPem',
|
|
45
|
+
:'key_passphrase' => :'keyPassphrase',
|
|
46
|
+
:'reason' => :'reason',
|
|
47
|
+
:'location' => :'location',
|
|
48
|
+
:'contact' => :'contact',
|
|
49
|
+
:'field_name' => :'fieldName',
|
|
50
|
+
:'use_pades_lt' => :'usePadesLt',
|
|
51
|
+
:'use_timestamp' => :'useTimestamp'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Returns attribute mapping this model knows about
|
|
56
|
+
def self.acceptable_attribute_map
|
|
57
|
+
attribute_map
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Returns all the JSON keys this model knows about
|
|
61
|
+
def self.acceptable_attributes
|
|
62
|
+
acceptable_attribute_map.values
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Attribute type mapping.
|
|
66
|
+
def self.openapi_types
|
|
67
|
+
{
|
|
68
|
+
:'key_pem' => :'String',
|
|
69
|
+
:'cert_pem' => :'String',
|
|
70
|
+
:'key_passphrase' => :'String',
|
|
71
|
+
:'reason' => :'String',
|
|
72
|
+
:'location' => :'String',
|
|
73
|
+
:'contact' => :'String',
|
|
74
|
+
:'field_name' => :'String',
|
|
75
|
+
:'use_pades_lt' => :'Boolean',
|
|
76
|
+
:'use_timestamp' => :'Boolean'
|
|
77
|
+
}
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# List of attributes with nullable: true
|
|
81
|
+
def self.openapi_nullable
|
|
82
|
+
Set.new([
|
|
83
|
+
:'key_pem',
|
|
84
|
+
:'cert_pem',
|
|
85
|
+
:'key_passphrase',
|
|
86
|
+
:'reason',
|
|
87
|
+
:'location',
|
|
88
|
+
:'contact',
|
|
89
|
+
])
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Initializes the object
|
|
93
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
94
|
+
def initialize(attributes = {})
|
|
95
|
+
if (!attributes.is_a?(Hash))
|
|
96
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::SignatureParameters` initialize method"
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
100
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
101
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
102
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
103
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::SignatureParameters`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
104
|
+
end
|
|
105
|
+
h[k.to_sym] = v
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'key_pem')
|
|
109
|
+
self.key_pem = attributes[:'key_pem']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'cert_pem')
|
|
113
|
+
self.cert_pem = attributes[:'cert_pem']
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'key_passphrase')
|
|
117
|
+
self.key_passphrase = attributes[:'key_passphrase']
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'reason')
|
|
121
|
+
self.reason = attributes[:'reason']
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'location')
|
|
125
|
+
self.location = attributes[:'location']
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'contact')
|
|
129
|
+
self.contact = attributes[:'contact']
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'field_name')
|
|
133
|
+
self.field_name = attributes[:'field_name']
|
|
134
|
+
else
|
|
135
|
+
self.field_name = 'FactPulseSignature'
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'use_pades_lt')
|
|
139
|
+
self.use_pades_lt = attributes[:'use_pades_lt']
|
|
140
|
+
else
|
|
141
|
+
self.use_pades_lt = false
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'use_timestamp')
|
|
145
|
+
self.use_timestamp = attributes[:'use_timestamp']
|
|
146
|
+
else
|
|
147
|
+
self.use_timestamp = true
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
152
|
+
# @return Array for valid properties with the reasons
|
|
153
|
+
def list_invalid_properties
|
|
154
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
155
|
+
invalid_properties = Array.new
|
|
156
|
+
invalid_properties
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Check to see if the all the properties in the model are valid
|
|
160
|
+
# @return true if the model is valid
|
|
161
|
+
def valid?
|
|
162
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
163
|
+
true
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Checks equality by comparing each attribute.
|
|
167
|
+
# @param [Object] Object to be compared
|
|
168
|
+
def ==(o)
|
|
169
|
+
return true if self.equal?(o)
|
|
170
|
+
self.class == o.class &&
|
|
171
|
+
key_pem == o.key_pem &&
|
|
172
|
+
cert_pem == o.cert_pem &&
|
|
173
|
+
key_passphrase == o.key_passphrase &&
|
|
174
|
+
reason == o.reason &&
|
|
175
|
+
location == o.location &&
|
|
176
|
+
contact == o.contact &&
|
|
177
|
+
field_name == o.field_name &&
|
|
178
|
+
use_pades_lt == o.use_pades_lt &&
|
|
179
|
+
use_timestamp == o.use_timestamp
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# @see the `==` method
|
|
183
|
+
# @param [Object] Object to be compared
|
|
184
|
+
def eql?(o)
|
|
185
|
+
self == o
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Calculates hash code according to all attributes.
|
|
189
|
+
# @return [Integer] Hash code
|
|
190
|
+
def hash
|
|
191
|
+
[key_pem, cert_pem, key_passphrase, reason, location, contact, field_name, use_pades_lt, use_timestamp].hash
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Builds the object from hash
|
|
195
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
196
|
+
# @return [Object] Returns the model itself
|
|
197
|
+
def self.build_from_hash(attributes)
|
|
198
|
+
return nil unless attributes.is_a?(Hash)
|
|
199
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
200
|
+
transformed_hash = {}
|
|
201
|
+
openapi_types.each_pair do |key, type|
|
|
202
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
203
|
+
transformed_hash["#{key}"] = nil
|
|
204
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
205
|
+
# check to ensure the input is an array given that the attribute
|
|
206
|
+
# is documented as an array but the input is not
|
|
207
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
208
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
209
|
+
end
|
|
210
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
211
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
new(transformed_hash)
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Returns the object in the form of hash
|
|
218
|
+
# @return [Hash] Returns the object in the form of hash
|
|
219
|
+
def to_hash
|
|
220
|
+
hash = {}
|
|
221
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
222
|
+
value = self.send(attr)
|
|
223
|
+
if value.nil?
|
|
224
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
225
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
hash[param] = _to_hash(value)
|
|
229
|
+
end
|
|
230
|
+
hash
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
end
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#FactPulse REST API
|
|
3
|
+
|
|
4
|
+
# REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF 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 - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 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://www.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://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.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://www.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://www.factpulse.fr/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://www.factpulse.fr/documentation-api/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.18.0-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module FactPulse
|
|
17
|
+
# Simplified invoice data (minimal format for auto-enrichment).
|
|
18
|
+
class SimplifiedInvoiceData < ApiModelBase
|
|
19
|
+
# Unique invoice number
|
|
20
|
+
attr_accessor :number
|
|
21
|
+
|
|
22
|
+
# Supplier information (siret, iban, ...)
|
|
23
|
+
attr_accessor :supplier
|
|
24
|
+
|
|
25
|
+
# Recipient information (siret, ...)
|
|
26
|
+
attr_accessor :recipient
|
|
27
|
+
|
|
28
|
+
# Invoice lines
|
|
29
|
+
attr_accessor :lines
|
|
30
|
+
|
|
31
|
+
attr_accessor :date
|
|
32
|
+
|
|
33
|
+
# Due date in days (default: 30)
|
|
34
|
+
attr_accessor :due_days
|
|
35
|
+
|
|
36
|
+
attr_accessor :comment
|
|
37
|
+
|
|
38
|
+
attr_accessor :purchase_order_reference
|
|
39
|
+
|
|
40
|
+
attr_accessor :contract_reference
|
|
41
|
+
|
|
42
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
43
|
+
def self.attribute_map
|
|
44
|
+
{
|
|
45
|
+
:'number' => :'number',
|
|
46
|
+
:'supplier' => :'supplier',
|
|
47
|
+
:'recipient' => :'recipient',
|
|
48
|
+
:'lines' => :'lines',
|
|
49
|
+
:'date' => :'date',
|
|
50
|
+
:'due_days' => :'dueDays',
|
|
51
|
+
:'comment' => :'comment',
|
|
52
|
+
:'purchase_order_reference' => :'purchaseOrderReference',
|
|
53
|
+
:'contract_reference' => :'contractReference'
|
|
54
|
+
}
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns attribute mapping this model knows about
|
|
58
|
+
def self.acceptable_attribute_map
|
|
59
|
+
attribute_map
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Returns all the JSON keys this model knows about
|
|
63
|
+
def self.acceptable_attributes
|
|
64
|
+
acceptable_attribute_map.values
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Attribute type mapping.
|
|
68
|
+
def self.openapi_types
|
|
69
|
+
{
|
|
70
|
+
:'number' => :'String',
|
|
71
|
+
:'supplier' => :'Hash<String, Object>',
|
|
72
|
+
:'recipient' => :'Hash<String, Object>',
|
|
73
|
+
:'lines' => :'Array<Hash<String, Object>>',
|
|
74
|
+
:'date' => :'String',
|
|
75
|
+
:'due_days' => :'Integer',
|
|
76
|
+
:'comment' => :'String',
|
|
77
|
+
:'purchase_order_reference' => :'String',
|
|
78
|
+
:'contract_reference' => :'String'
|
|
79
|
+
}
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# List of attributes with nullable: true
|
|
83
|
+
def self.openapi_nullable
|
|
84
|
+
Set.new([
|
|
85
|
+
:'date',
|
|
86
|
+
:'comment',
|
|
87
|
+
:'purchase_order_reference',
|
|
88
|
+
:'contract_reference'
|
|
89
|
+
])
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Initializes the object
|
|
93
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
94
|
+
def initialize(attributes = {})
|
|
95
|
+
if (!attributes.is_a?(Hash))
|
|
96
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::SimplifiedInvoiceData` initialize method"
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
100
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
101
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
102
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
103
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::SimplifiedInvoiceData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
104
|
+
end
|
|
105
|
+
h[k.to_sym] = v
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'number')
|
|
109
|
+
self.number = attributes[:'number']
|
|
110
|
+
else
|
|
111
|
+
self.number = nil
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'supplier')
|
|
115
|
+
if (value = attributes[:'supplier']).is_a?(Hash)
|
|
116
|
+
self.supplier = value
|
|
117
|
+
end
|
|
118
|
+
else
|
|
119
|
+
self.supplier = nil
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'recipient')
|
|
123
|
+
if (value = attributes[:'recipient']).is_a?(Hash)
|
|
124
|
+
self.recipient = value
|
|
125
|
+
end
|
|
126
|
+
else
|
|
127
|
+
self.recipient = nil
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'lines')
|
|
131
|
+
if (value = attributes[:'lines']).is_a?(Array)
|
|
132
|
+
self.lines = value
|
|
133
|
+
end
|
|
134
|
+
else
|
|
135
|
+
self.lines = nil
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'date')
|
|
139
|
+
self.date = attributes[:'date']
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'due_days')
|
|
143
|
+
self.due_days = attributes[:'due_days']
|
|
144
|
+
else
|
|
145
|
+
self.due_days = 30
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'comment')
|
|
149
|
+
self.comment = attributes[:'comment']
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:'purchase_order_reference')
|
|
153
|
+
self.purchase_order_reference = attributes[:'purchase_order_reference']
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'contract_reference')
|
|
157
|
+
self.contract_reference = attributes[:'contract_reference']
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
162
|
+
# @return Array for valid properties with the reasons
|
|
163
|
+
def list_invalid_properties
|
|
164
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
165
|
+
invalid_properties = Array.new
|
|
166
|
+
if @number.nil?
|
|
167
|
+
invalid_properties.push('invalid value for "number", number cannot be nil.')
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if @supplier.nil?
|
|
171
|
+
invalid_properties.push('invalid value for "supplier", supplier cannot be nil.')
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if @recipient.nil?
|
|
175
|
+
invalid_properties.push('invalid value for "recipient", recipient cannot be nil.')
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
if @lines.nil?
|
|
179
|
+
invalid_properties.push('invalid value for "lines", lines cannot be nil.')
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
if @lines.length < 1
|
|
183
|
+
invalid_properties.push('invalid value for "lines", number of items must be greater than or equal to 1.')
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
if !@due_days.nil? && @due_days > 365
|
|
187
|
+
invalid_properties.push('invalid value for "due_days", must be smaller than or equal to 365.')
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
if !@due_days.nil? && @due_days < 0
|
|
191
|
+
invalid_properties.push('invalid value for "due_days", must be greater than or equal to 0.')
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
invalid_properties
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Check to see if the all the properties in the model are valid
|
|
198
|
+
# @return true if the model is valid
|
|
199
|
+
def valid?
|
|
200
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
201
|
+
return false if @number.nil?
|
|
202
|
+
return false if @supplier.nil?
|
|
203
|
+
return false if @recipient.nil?
|
|
204
|
+
return false if @lines.nil?
|
|
205
|
+
return false if @lines.length < 1
|
|
206
|
+
return false if !@due_days.nil? && @due_days > 365
|
|
207
|
+
return false if !@due_days.nil? && @due_days < 0
|
|
208
|
+
true
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Custom attribute writer method with validation
|
|
212
|
+
# @param [Object] number Value to be assigned
|
|
213
|
+
def number=(number)
|
|
214
|
+
if number.nil?
|
|
215
|
+
fail ArgumentError, 'number cannot be nil'
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
@number = number
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Custom attribute writer method with validation
|
|
222
|
+
# @param [Object] supplier Value to be assigned
|
|
223
|
+
def supplier=(supplier)
|
|
224
|
+
if supplier.nil?
|
|
225
|
+
fail ArgumentError, 'supplier cannot be nil'
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
@supplier = supplier
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Custom attribute writer method with validation
|
|
232
|
+
# @param [Object] recipient Value to be assigned
|
|
233
|
+
def recipient=(recipient)
|
|
234
|
+
if recipient.nil?
|
|
235
|
+
fail ArgumentError, 'recipient cannot be nil'
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
@recipient = recipient
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Custom attribute writer method with validation
|
|
242
|
+
# @param [Object] lines Value to be assigned
|
|
243
|
+
def lines=(lines)
|
|
244
|
+
if lines.nil?
|
|
245
|
+
fail ArgumentError, 'lines cannot be nil'
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
if lines.length < 1
|
|
249
|
+
fail ArgumentError, 'invalid value for "lines", number of items must be greater than or equal to 1.'
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
@lines = lines
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Custom attribute writer method with validation
|
|
256
|
+
# @param [Object] due_days Value to be assigned
|
|
257
|
+
def due_days=(due_days)
|
|
258
|
+
if due_days.nil?
|
|
259
|
+
fail ArgumentError, 'due_days cannot be nil'
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
if due_days > 365
|
|
263
|
+
fail ArgumentError, 'invalid value for "due_days", must be smaller than or equal to 365.'
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
if due_days < 0
|
|
267
|
+
fail ArgumentError, 'invalid value for "due_days", must be greater than or equal to 0.'
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
@due_days = due_days
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
# Checks equality by comparing each attribute.
|
|
274
|
+
# @param [Object] Object to be compared
|
|
275
|
+
def ==(o)
|
|
276
|
+
return true if self.equal?(o)
|
|
277
|
+
self.class == o.class &&
|
|
278
|
+
number == o.number &&
|
|
279
|
+
supplier == o.supplier &&
|
|
280
|
+
recipient == o.recipient &&
|
|
281
|
+
lines == o.lines &&
|
|
282
|
+
date == o.date &&
|
|
283
|
+
due_days == o.due_days &&
|
|
284
|
+
comment == o.comment &&
|
|
285
|
+
purchase_order_reference == o.purchase_order_reference &&
|
|
286
|
+
contract_reference == o.contract_reference
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# @see the `==` method
|
|
290
|
+
# @param [Object] Object to be compared
|
|
291
|
+
def eql?(o)
|
|
292
|
+
self == o
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
# Calculates hash code according to all attributes.
|
|
296
|
+
# @return [Integer] Hash code
|
|
297
|
+
def hash
|
|
298
|
+
[number, supplier, recipient, lines, date, due_days, comment, purchase_order_reference, contract_reference].hash
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
# Builds the object from hash
|
|
302
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
303
|
+
# @return [Object] Returns the model itself
|
|
304
|
+
def self.build_from_hash(attributes)
|
|
305
|
+
return nil unless attributes.is_a?(Hash)
|
|
306
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
307
|
+
transformed_hash = {}
|
|
308
|
+
openapi_types.each_pair do |key, type|
|
|
309
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
310
|
+
transformed_hash["#{key}"] = nil
|
|
311
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
312
|
+
# check to ensure the input is an array given that the attribute
|
|
313
|
+
# is documented as an array but the input is not
|
|
314
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
315
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
316
|
+
end
|
|
317
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
318
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
319
|
+
end
|
|
320
|
+
end
|
|
321
|
+
new(transformed_hash)
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
# Returns the object in the form of hash
|
|
325
|
+
# @return [Hash] Returns the object in the form of hash
|
|
326
|
+
def to_hash
|
|
327
|
+
hash = {}
|
|
328
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
329
|
+
value = self.send(attr)
|
|
330
|
+
if value.nil?
|
|
331
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
332
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
hash[param] = _to_hash(value)
|
|
336
|
+
end
|
|
337
|
+
hash
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
end
|