factpulse 1.0.9__py3-none-any.whl → 3.0.7__py3-none-any.whl
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.
Potentially problematic release.
This version of factpulse might be problematic. Click here for more details.
- factpulse/__init__.py +275 -203
- factpulse/api/__init__.py +5 -3
- factpulse/api/afnorpdppa_api.py +559 -9
- factpulse/api/afnorpdppa_directory_service_api.py +4313 -66
- factpulse/api/afnorpdppa_flow_service_api.py +23 -23
- factpulse/api/chorus_pro_api.py +362 -404
- factpulse/api/{signature_lectronique_api.py → document_conversion_api.py} +519 -371
- factpulse/api/health_api.py +526 -0
- factpulse/api/invoice_processing_api.py +3437 -0
- factpulse/api/pdfxml_verification_api.py +1719 -0
- factpulse/api/{sant_api.py → user_api.py} +18 -17
- factpulse/api_client.py +6 -6
- factpulse/configuration.py +6 -4
- factpulse/exceptions.py +8 -5
- factpulse/models/__init__.py +133 -99
- factpulse/models/acknowledgment_status.py +38 -0
- factpulse/models/additional_document.py +115 -0
- factpulse/models/afnor_credentials.py +106 -0
- factpulse/models/afnor_destination.py +127 -0
- factpulse/models/afnor_health_check_response.py +91 -0
- factpulse/models/afnor_result.py +105 -0
- factpulse/models/allowance_charge.py +147 -0
- factpulse/models/allowance_reason_code.py +42 -0
- factpulse/models/allowance_total_amount.py +145 -0
- factpulse/models/amount.py +139 -0
- factpulse/models/amount_due.py +139 -0
- factpulse/models/api_error.py +104 -0
- factpulse/models/async_task_status.py +97 -0
- factpulse/models/base_amount.py +145 -0
- factpulse/models/bounding_box_schema.py +100 -0
- factpulse/models/celery_status.py +40 -0
- factpulse/models/certificate_info_response.py +24 -24
- factpulse/models/charge_total_amount.py +145 -0
- factpulse/models/chorus_pro_destination.py +108 -0
- factpulse/models/chorus_pro_result.py +101 -0
- factpulse/models/contact.py +113 -0
- factpulse/models/convert_error_response.py +105 -0
- factpulse/models/convert_pending_input_response.py +114 -0
- factpulse/models/convert_resume_request.py +87 -0
- factpulse/models/convert_success_response.py +126 -0
- factpulse/models/convert_validation_failed_response.py +120 -0
- factpulse/models/delivery_party.py +121 -0
- factpulse/models/destination.py +27 -27
- factpulse/models/document_type_info.py +91 -0
- factpulse/models/electronic_address.py +90 -0
- factpulse/models/enriched_invoice_info.py +133 -0
- factpulse/models/error_level.py +37 -0
- factpulse/models/error_source.py +43 -0
- factpulse/models/extraction_info.py +93 -0
- factpulse/models/factur_x_invoice.py +320 -0
- factpulse/models/factur_x_profile.py +39 -0
- factpulse/models/factur_xpdf_info.py +91 -0
- factpulse/models/facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.py +95 -0
- factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.py +115 -0
- factpulse/models/field_status.py +40 -0
- factpulse/models/file_info.py +94 -0
- factpulse/models/files_info.py +106 -0
- factpulse/models/flow_direction.py +37 -0
- factpulse/models/flow_profile.py +38 -0
- factpulse/models/flow_summary.py +131 -0
- factpulse/models/flow_syntax.py +40 -0
- factpulse/models/flow_type.py +40 -0
- factpulse/models/generate_certificate_request.py +26 -26
- factpulse/models/generate_certificate_response.py +15 -15
- factpulse/models/get_chorus_pro_id_request.py +100 -0
- factpulse/models/get_chorus_pro_id_response.py +98 -0
- factpulse/models/get_invoice_request.py +98 -0
- factpulse/models/get_invoice_response.py +142 -0
- factpulse/models/get_structure_request.py +100 -0
- factpulse/models/get_structure_response.py +142 -0
- factpulse/models/global_allowance_amount.py +139 -0
- factpulse/models/gross_unit_price.py +145 -0
- factpulse/models/http_validation_error.py +2 -2
- factpulse/models/incoming_invoice.py +196 -0
- factpulse/models/incoming_supplier.py +144 -0
- factpulse/models/invoice_format.py +38 -0
- factpulse/models/invoice_line.py +354 -0
- factpulse/models/invoice_line_allowance_amount.py +145 -0
- factpulse/models/invoice_note.py +94 -0
- factpulse/models/invoice_references.py +194 -0
- factpulse/models/invoice_status.py +96 -0
- factpulse/models/invoice_totals.py +177 -0
- factpulse/models/invoice_totals_prepayment.py +145 -0
- factpulse/models/invoice_type_code.py +51 -0
- factpulse/models/invoicing_framework.py +110 -0
- factpulse/models/invoicing_framework_code.py +39 -0
- factpulse/models/line_net_amount.py +145 -0
- factpulse/models/line_total_amount.py +145 -0
- factpulse/models/mandatory_note_schema.py +124 -0
- factpulse/models/manual_rate.py +139 -0
- factpulse/models/manual_vat_rate.py +139 -0
- factpulse/models/missing_field.py +107 -0
- factpulse/models/operation_nature.py +49 -0
- factpulse/models/output_format.py +37 -0
- factpulse/models/page_dimensions_schema.py +89 -0
- factpulse/models/payee.py +168 -0
- factpulse/models/payment_card.py +99 -0
- factpulse/models/payment_means.py +41 -0
- factpulse/models/pdf_validation_result_api.py +169 -0
- factpulse/models/pdp_credentials.py +20 -13
- factpulse/models/percentage.py +145 -0
- factpulse/models/postal_address.py +134 -0
- factpulse/models/price_allowance_amount.py +145 -0
- factpulse/models/price_basis_quantity.py +145 -0
- factpulse/models/processing_options.py +94 -0
- factpulse/models/product_characteristic.py +89 -0
- factpulse/models/product_classification.py +101 -0
- factpulse/models/quantity.py +139 -0
- factpulse/models/recipient.py +167 -0
- factpulse/models/rounding_amount.py +145 -0
- factpulse/models/scheme_id.py +14 -8
- factpulse/models/search_flow_request.py +143 -0
- factpulse/models/search_flow_response.py +101 -0
- factpulse/models/search_services_response.py +101 -0
- factpulse/models/search_structure_request.py +119 -0
- factpulse/models/search_structure_response.py +101 -0
- factpulse/models/signature_info.py +6 -6
- factpulse/models/signature_info_api.py +122 -0
- factpulse/models/signature_parameters.py +133 -0
- factpulse/models/simplified_invoice_data.py +124 -0
- factpulse/models/structure_info.py +14 -14
- factpulse/models/structure_parameters.py +91 -0
- factpulse/models/structure_service.py +93 -0
- factpulse/models/submission_mode.py +38 -0
- factpulse/models/submit_complete_invoice_request.py +116 -0
- factpulse/models/submit_complete_invoice_response.py +145 -0
- factpulse/models/submit_flow_request.py +123 -0
- factpulse/models/submit_flow_response.py +109 -0
- factpulse/models/submit_gross_amount.py +139 -0
- factpulse/models/submit_invoice_request.py +176 -0
- factpulse/models/submit_invoice_response.py +103 -0
- factpulse/models/submit_net_amount.py +139 -0
- factpulse/models/submit_vat_amount.py +139 -0
- factpulse/models/supplementary_attachment.py +95 -0
- factpulse/models/supplier.py +225 -0
- factpulse/models/task_response.py +87 -0
- factpulse/models/tax_representative.py +95 -0
- factpulse/models/taxable_amount.py +139 -0
- factpulse/models/total_gross_amount.py +139 -0
- factpulse/models/total_net_amount.py +139 -0
- factpulse/models/total_vat_amount.py +139 -0
- factpulse/models/unit_net_price.py +139 -0
- factpulse/models/unit_of_measure.py +41 -0
- factpulse/models/validation_error.py +2 -2
- factpulse/models/validation_error_detail.py +107 -0
- factpulse/models/validation_error_loc_inner.py +2 -2
- factpulse/models/validation_error_response.py +87 -0
- factpulse/models/validation_info.py +105 -0
- factpulse/models/validation_success_response.py +87 -0
- factpulse/models/vat_accounting_code.py +39 -0
- factpulse/models/vat_amount.py +139 -0
- factpulse/models/vat_category.py +44 -0
- factpulse/models/vat_line.py +140 -0
- factpulse/models/vat_point_date_code.py +38 -0
- factpulse/models/vat_rate.py +145 -0
- factpulse/models/verification_success_response.py +135 -0
- factpulse/models/verified_field_schema.py +129 -0
- factpulse/rest.py +9 -4
- factpulse-3.0.7.dist-info/METADATA +292 -0
- factpulse-3.0.7.dist-info/RECORD +168 -0
- factpulse-3.0.7.dist-info/top_level.txt +2 -0
- factpulse_helpers/__init__.py +96 -0
- factpulse_helpers/client.py +2111 -0
- factpulse_helpers/exceptions.py +253 -0
- factpulse/api/processing_endpoints_unifis_api.py +0 -592
- factpulse/api/traitement_facture_api.py +0 -3439
- factpulse/api/utilisateur_api.py +0 -282
- factpulse/models/adresse_electronique.py +0 -90
- factpulse/models/adresse_postale.py +0 -120
- factpulse/models/body_ajouter_fichier_api_v1_chorus_pro_transverses_ajouter_fichier_post.py +0 -104
- factpulse/models/body_completer_facture_api_v1_chorus_pro_factures_completer_post.py +0 -104
- factpulse/models/body_lister_services_structure_api_v1_chorus_pro_structures_id_structure_cpp_services_get.py +0 -102
- factpulse/models/body_rechercher_factures_destinataire_api_v1_chorus_pro_factures_rechercher_destinataire_post.py +0 -104
- factpulse/models/body_rechercher_factures_fournisseur_api_v1_chorus_pro_factures_rechercher_fournisseur_post.py +0 -104
- factpulse/models/body_recycler_facture_api_v1_chorus_pro_factures_recycler_post.py +0 -104
- factpulse/models/body_telecharger_groupe_factures_api_v1_chorus_pro_factures_telecharger_groupe_post.py +0 -104
- factpulse/models/body_traiter_facture_recue_api_v1_chorus_pro_factures_traiter_facture_recue_post.py +0 -104
- factpulse/models/body_valideur_consulter_facture_api_v1_chorus_pro_factures_valideur_consulter_post.py +0 -104
- factpulse/models/body_valideur_rechercher_factures_api_v1_chorus_pro_factures_valideur_rechercher_post.py +0 -104
- factpulse/models/body_valideur_traiter_facture_api_v1_chorus_pro_factures_valideur_traiter_post.py +0 -104
- factpulse/models/cadre_de_facturation.py +0 -102
- factpulse/models/categorie_tva.py +0 -44
- factpulse/models/chorus_pro_credentials.py +0 -95
- factpulse/models/code_cadre_facturation.py +0 -39
- factpulse/models/code_raison_reduction.py +0 -42
- factpulse/models/consulter_facture_request.py +0 -98
- factpulse/models/consulter_facture_response.py +0 -142
- factpulse/models/consulter_structure_request.py +0 -100
- factpulse/models/consulter_structure_response.py +0 -142
- factpulse/models/credentials_afnor.py +0 -106
- factpulse/models/credentials_chorus_pro.py +0 -115
- factpulse/models/destinataire.py +0 -116
- factpulse/models/destination_afnor.py +0 -127
- factpulse/models/destination_chorus_pro.py +0 -108
- factpulse/models/direction_flux.py +0 -37
- factpulse/models/donnees_facture_simplifiees.py +0 -124
- factpulse/models/facture_enrichie_info_input.py +0 -123
- factpulse/models/facture_enrichie_info_output.py +0 -133
- factpulse/models/facture_factur_x.py +0 -173
- factpulse/models/flux_resume.py +0 -131
- factpulse/models/format_sortie.py +0 -37
- factpulse/models/fournisseur.py +0 -146
- factpulse/models/information_signature_api.py +0 -122
- factpulse/models/ligne_de_poste.py +0 -188
- factpulse/models/ligne_de_poste_montant_remise_ht.py +0 -145
- factpulse/models/ligne_de_poste_montant_total_ligne_ht.py +0 -145
- factpulse/models/ligne_de_poste_taux_tva_manuel.py +0 -145
- factpulse/models/ligne_de_tva.py +0 -118
- factpulse/models/mode_depot.py +0 -38
- factpulse/models/mode_paiement.py +0 -41
- factpulse/models/montant_ht_total.py +0 -139
- factpulse/models/montant_total.py +0 -138
- factpulse/models/montant_total_acompte.py +0 -145
- factpulse/models/montant_total_montant_remise_globale_ttc.py +0 -145
- factpulse/models/montant_ttc_total.py +0 -139
- factpulse/models/montant_tva.py +0 -139
- factpulse/models/montantapayer.py +0 -139
- factpulse/models/montantbaseht.py +0 -139
- factpulse/models/montanthttotal.py +0 -139
- factpulse/models/montantttctotal.py +0 -139
- factpulse/models/montanttva.py +0 -139
- factpulse/models/montanttva1.py +0 -139
- factpulse/models/montantunitaireht.py +0 -139
- factpulse/models/obtenir_id_chorus_pro_request.py +0 -100
- factpulse/models/obtenir_id_chorus_pro_response.py +0 -98
- factpulse/models/options_processing.py +0 -94
- factpulse/models/parametres_signature.py +0 -133
- factpulse/models/parametres_structure.py +0 -91
- factpulse/models/pdf_factur_x_info.py +0 -91
- factpulse/models/piece_jointe_complementaire.py +0 -95
- factpulse/models/profil_api.py +0 -39
- factpulse/models/profil_flux.py +0 -38
- factpulse/models/quantite.py +0 -139
- factpulse/models/quota_info.py +0 -95
- factpulse/models/rechercher_services_response.py +0 -101
- factpulse/models/rechercher_structure_request.py +0 -119
- factpulse/models/rechercher_structure_response.py +0 -101
- factpulse/models/references.py +0 -124
- factpulse/models/reponse_healthcheck_afnor.py +0 -91
- factpulse/models/reponse_recherche_flux.py +0 -101
- factpulse/models/reponse_soumission_flux.py +0 -109
- factpulse/models/reponse_tache.py +0 -87
- factpulse/models/reponse_validation_erreur.py +0 -87
- factpulse/models/reponse_validation_succes.py +0 -87
- factpulse/models/requete_recherche_flux.py +0 -143
- factpulse/models/requete_soumission_flux.py +0 -123
- factpulse/models/resultat_afnor.py +0 -105
- factpulse/models/resultat_chorus_pro.py +0 -101
- factpulse/models/resultat_validation_pdfapi.py +0 -169
- factpulse/models/service_structure.py +0 -93
- factpulse/models/soumettre_facture_complete_request.py +0 -116
- factpulse/models/soumettre_facture_complete_response.py +0 -145
- factpulse/models/soumettre_facture_request.py +0 -164
- factpulse/models/soumettre_facture_response.py +0 -103
- factpulse/models/statut_acquittement.py +0 -38
- factpulse/models/statut_facture.py +0 -96
- factpulse/models/statut_tache.py +0 -99
- factpulse/models/syntaxe_flux.py +0 -40
- factpulse/models/tauxmanuel.py +0 -139
- factpulse/models/type_facture.py +0 -37
- factpulse/models/type_flux.py +0 -40
- factpulse/models/type_tva.py +0 -39
- factpulse/models/unite.py +0 -41
- factpulse/models/utilisateur.py +0 -128
- factpulse-1.0.9.dist-info/METADATA +0 -182
- factpulse-1.0.9.dist-info/RECORD +0 -131
- factpulse-1.0.9.dist-info/top_level.txt +0 -1
- {factpulse-1.0.9.dist-info → factpulse-3.0.7.dist-info}/WHEEL +0 -0
- {factpulse-1.0.9.dist-info → factpulse-3.0.7.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : https://www.factpulse.fr/documentation-api/
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.0
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import pprint
|
|
17
|
-
import re # noqa: F401
|
|
18
|
-
import json
|
|
19
|
-
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from typing_extensions import Annotated
|
|
23
|
-
from typing import Optional, Set
|
|
24
|
-
from typing_extensions import Self
|
|
25
|
-
|
|
26
|
-
class FactureEnrichieInfoOutput(BaseModel):
|
|
27
|
-
"""
|
|
28
|
-
Informations sur la facture enrichie.
|
|
29
|
-
""" # noqa: E501
|
|
30
|
-
numero_facture: StrictStr
|
|
31
|
-
id_emetteur: Optional[StrictInt] = None
|
|
32
|
-
id_destinataire: Optional[StrictInt] = None
|
|
33
|
-
nom_emetteur: StrictStr
|
|
34
|
-
nom_destinataire: StrictStr
|
|
35
|
-
montant_ht_total: Annotated[str, Field(strict=True)]
|
|
36
|
-
montant_tva: Annotated[str, Field(strict=True)]
|
|
37
|
-
montant_ttc_total: Annotated[str, Field(strict=True)]
|
|
38
|
-
__properties: ClassVar[List[str]] = ["numero_facture", "id_emetteur", "id_destinataire", "nom_emetteur", "nom_destinataire", "montant_ht_total", "montant_tva", "montant_ttc_total"]
|
|
39
|
-
|
|
40
|
-
@field_validator('montant_ht_total')
|
|
41
|
-
def montant_ht_total_validate_regular_expression(cls, value):
|
|
42
|
-
"""Validates the regular expression"""
|
|
43
|
-
if not re.match(r"^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$", value):
|
|
44
|
-
raise ValueError(r"must validate the regular expression /^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/")
|
|
45
|
-
return value
|
|
46
|
-
|
|
47
|
-
@field_validator('montant_tva')
|
|
48
|
-
def montant_tva_validate_regular_expression(cls, value):
|
|
49
|
-
"""Validates the regular expression"""
|
|
50
|
-
if not re.match(r"^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$", value):
|
|
51
|
-
raise ValueError(r"must validate the regular expression /^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/")
|
|
52
|
-
return value
|
|
53
|
-
|
|
54
|
-
@field_validator('montant_ttc_total')
|
|
55
|
-
def montant_ttc_total_validate_regular_expression(cls, value):
|
|
56
|
-
"""Validates the regular expression"""
|
|
57
|
-
if not re.match(r"^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$", value):
|
|
58
|
-
raise ValueError(r"must validate the regular expression /^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/")
|
|
59
|
-
return value
|
|
60
|
-
|
|
61
|
-
model_config = ConfigDict(
|
|
62
|
-
populate_by_name=True,
|
|
63
|
-
validate_assignment=True,
|
|
64
|
-
protected_namespaces=(),
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
def to_str(self) -> str:
|
|
69
|
-
"""Returns the string representation of the model using alias"""
|
|
70
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
71
|
-
|
|
72
|
-
def to_json(self) -> str:
|
|
73
|
-
"""Returns the JSON representation of the model using alias"""
|
|
74
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
75
|
-
return json.dumps(self.to_dict())
|
|
76
|
-
|
|
77
|
-
@classmethod
|
|
78
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
79
|
-
"""Create an instance of FactureEnrichieInfoOutput from a JSON string"""
|
|
80
|
-
return cls.from_dict(json.loads(json_str))
|
|
81
|
-
|
|
82
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
83
|
-
"""Return the dictionary representation of the model using alias.
|
|
84
|
-
|
|
85
|
-
This has the following differences from calling pydantic's
|
|
86
|
-
`self.model_dump(by_alias=True)`:
|
|
87
|
-
|
|
88
|
-
* `None` is only added to the output dict for nullable fields that
|
|
89
|
-
were set at model initialization. Other fields with value `None`
|
|
90
|
-
are ignored.
|
|
91
|
-
"""
|
|
92
|
-
excluded_fields: Set[str] = set([
|
|
93
|
-
])
|
|
94
|
-
|
|
95
|
-
_dict = self.model_dump(
|
|
96
|
-
by_alias=True,
|
|
97
|
-
exclude=excluded_fields,
|
|
98
|
-
exclude_none=True,
|
|
99
|
-
)
|
|
100
|
-
# set to None if id_emetteur (nullable) is None
|
|
101
|
-
# and model_fields_set contains the field
|
|
102
|
-
if self.id_emetteur is None and "id_emetteur" in self.model_fields_set:
|
|
103
|
-
_dict['id_emetteur'] = None
|
|
104
|
-
|
|
105
|
-
# set to None if id_destinataire (nullable) is None
|
|
106
|
-
# and model_fields_set contains the field
|
|
107
|
-
if self.id_destinataire is None and "id_destinataire" in self.model_fields_set:
|
|
108
|
-
_dict['id_destinataire'] = None
|
|
109
|
-
|
|
110
|
-
return _dict
|
|
111
|
-
|
|
112
|
-
@classmethod
|
|
113
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
114
|
-
"""Create an instance of FactureEnrichieInfoOutput from a dict"""
|
|
115
|
-
if obj is None:
|
|
116
|
-
return None
|
|
117
|
-
|
|
118
|
-
if not isinstance(obj, dict):
|
|
119
|
-
return cls.model_validate(obj)
|
|
120
|
-
|
|
121
|
-
_obj = cls.model_validate({
|
|
122
|
-
"numero_facture": obj.get("numero_facture"),
|
|
123
|
-
"id_emetteur": obj.get("id_emetteur"),
|
|
124
|
-
"id_destinataire": obj.get("id_destinataire"),
|
|
125
|
-
"nom_emetteur": obj.get("nom_emetteur"),
|
|
126
|
-
"nom_destinataire": obj.get("nom_destinataire"),
|
|
127
|
-
"montant_ht_total": obj.get("montant_ht_total"),
|
|
128
|
-
"montant_tva": obj.get("montant_tva"),
|
|
129
|
-
"montant_ttc_total": obj.get("montant_ttc_total")
|
|
130
|
-
})
|
|
131
|
-
return _obj
|
|
132
|
-
|
|
133
|
-
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : https://www.factpulse.fr/documentation-api/
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.0
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import pprint
|
|
17
|
-
import re # noqa: F401
|
|
18
|
-
import json
|
|
19
|
-
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from factpulse.models.cadre_de_facturation import CadreDeFacturation
|
|
23
|
-
from factpulse.models.destinataire import Destinataire
|
|
24
|
-
from factpulse.models.fournisseur import Fournisseur
|
|
25
|
-
from factpulse.models.ligne_de_poste import LigneDePoste
|
|
26
|
-
from factpulse.models.ligne_de_tva import LigneDeTVA
|
|
27
|
-
from factpulse.models.mode_depot import ModeDepot
|
|
28
|
-
from factpulse.models.montant_total import MontantTotal
|
|
29
|
-
from factpulse.models.piece_jointe_complementaire import PieceJointeComplementaire
|
|
30
|
-
from factpulse.models.references import References
|
|
31
|
-
from typing import Optional, Set
|
|
32
|
-
from typing_extensions import Self
|
|
33
|
-
|
|
34
|
-
class FactureFacturX(BaseModel):
|
|
35
|
-
"""
|
|
36
|
-
Modèle de données pour une facture destinée à être convertie en Factur-X.
|
|
37
|
-
""" # noqa: E501
|
|
38
|
-
numero_facture: StrictStr = Field(alias="numeroFacture")
|
|
39
|
-
date_echeance_paiement: StrictStr = Field(alias="dateEcheancePaiement")
|
|
40
|
-
date_facture: Optional[StrictStr] = Field(default=None, alias="dateFacture")
|
|
41
|
-
mode_depot: ModeDepot = Field(alias="modeDepot")
|
|
42
|
-
destinataire: Destinataire
|
|
43
|
-
fournisseur: Fournisseur
|
|
44
|
-
cadre_de_facturation: CadreDeFacturation = Field(alias="cadreDeFacturation")
|
|
45
|
-
references: References
|
|
46
|
-
montant_total: MontantTotal = Field(alias="montantTotal")
|
|
47
|
-
lignes_de_poste: Optional[List[LigneDePoste]] = Field(default=None, alias="lignesDePoste")
|
|
48
|
-
lignes_de_tva: Optional[List[LigneDeTVA]] = Field(default=None, alias="lignesDeTva")
|
|
49
|
-
commentaire: Optional[StrictStr] = None
|
|
50
|
-
id_utilisateur_courant: Optional[StrictInt] = Field(default=None, alias="idUtilisateurCourant")
|
|
51
|
-
pieces_jointes_complementaires: Optional[List[PieceJointeComplementaire]] = Field(default=None, alias="piecesJointesComplementaires")
|
|
52
|
-
__properties: ClassVar[List[str]] = ["numeroFacture", "dateEcheancePaiement", "dateFacture", "modeDepot", "destinataire", "fournisseur", "cadreDeFacturation", "references", "montantTotal", "lignesDePoste", "lignesDeTva", "commentaire", "idUtilisateurCourant", "piecesJointesComplementaires"]
|
|
53
|
-
|
|
54
|
-
model_config = ConfigDict(
|
|
55
|
-
populate_by_name=True,
|
|
56
|
-
validate_assignment=True,
|
|
57
|
-
protected_namespaces=(),
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
def to_str(self) -> str:
|
|
62
|
-
"""Returns the string representation of the model using alias"""
|
|
63
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
64
|
-
|
|
65
|
-
def to_json(self) -> str:
|
|
66
|
-
"""Returns the JSON representation of the model using alias"""
|
|
67
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
68
|
-
return json.dumps(self.to_dict())
|
|
69
|
-
|
|
70
|
-
@classmethod
|
|
71
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
72
|
-
"""Create an instance of FactureFacturX from a JSON string"""
|
|
73
|
-
return cls.from_dict(json.loads(json_str))
|
|
74
|
-
|
|
75
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
76
|
-
"""Return the dictionary representation of the model using alias.
|
|
77
|
-
|
|
78
|
-
This has the following differences from calling pydantic's
|
|
79
|
-
`self.model_dump(by_alias=True)`:
|
|
80
|
-
|
|
81
|
-
* `None` is only added to the output dict for nullable fields that
|
|
82
|
-
were set at model initialization. Other fields with value `None`
|
|
83
|
-
are ignored.
|
|
84
|
-
"""
|
|
85
|
-
excluded_fields: Set[str] = set([
|
|
86
|
-
])
|
|
87
|
-
|
|
88
|
-
_dict = self.model_dump(
|
|
89
|
-
by_alias=True,
|
|
90
|
-
exclude=excluded_fields,
|
|
91
|
-
exclude_none=True,
|
|
92
|
-
)
|
|
93
|
-
# override the default output from pydantic by calling `to_dict()` of destinataire
|
|
94
|
-
if self.destinataire:
|
|
95
|
-
_dict['destinataire'] = self.destinataire.to_dict()
|
|
96
|
-
# override the default output from pydantic by calling `to_dict()` of fournisseur
|
|
97
|
-
if self.fournisseur:
|
|
98
|
-
_dict['fournisseur'] = self.fournisseur.to_dict()
|
|
99
|
-
# override the default output from pydantic by calling `to_dict()` of cadre_de_facturation
|
|
100
|
-
if self.cadre_de_facturation:
|
|
101
|
-
_dict['cadreDeFacturation'] = self.cadre_de_facturation.to_dict()
|
|
102
|
-
# override the default output from pydantic by calling `to_dict()` of references
|
|
103
|
-
if self.references:
|
|
104
|
-
_dict['references'] = self.references.to_dict()
|
|
105
|
-
# override the default output from pydantic by calling `to_dict()` of montant_total
|
|
106
|
-
if self.montant_total:
|
|
107
|
-
_dict['montantTotal'] = self.montant_total.to_dict()
|
|
108
|
-
# override the default output from pydantic by calling `to_dict()` of each item in lignes_de_poste (list)
|
|
109
|
-
_items = []
|
|
110
|
-
if self.lignes_de_poste:
|
|
111
|
-
for _item_lignes_de_poste in self.lignes_de_poste:
|
|
112
|
-
if _item_lignes_de_poste:
|
|
113
|
-
_items.append(_item_lignes_de_poste.to_dict())
|
|
114
|
-
_dict['lignesDePoste'] = _items
|
|
115
|
-
# override the default output from pydantic by calling `to_dict()` of each item in lignes_de_tva (list)
|
|
116
|
-
_items = []
|
|
117
|
-
if self.lignes_de_tva:
|
|
118
|
-
for _item_lignes_de_tva in self.lignes_de_tva:
|
|
119
|
-
if _item_lignes_de_tva:
|
|
120
|
-
_items.append(_item_lignes_de_tva.to_dict())
|
|
121
|
-
_dict['lignesDeTva'] = _items
|
|
122
|
-
# override the default output from pydantic by calling `to_dict()` of each item in pieces_jointes_complementaires (list)
|
|
123
|
-
_items = []
|
|
124
|
-
if self.pieces_jointes_complementaires:
|
|
125
|
-
for _item_pieces_jointes_complementaires in self.pieces_jointes_complementaires:
|
|
126
|
-
if _item_pieces_jointes_complementaires:
|
|
127
|
-
_items.append(_item_pieces_jointes_complementaires.to_dict())
|
|
128
|
-
_dict['piecesJointesComplementaires'] = _items
|
|
129
|
-
# set to None if commentaire (nullable) is None
|
|
130
|
-
# and model_fields_set contains the field
|
|
131
|
-
if self.commentaire is None and "commentaire" in self.model_fields_set:
|
|
132
|
-
_dict['commentaire'] = None
|
|
133
|
-
|
|
134
|
-
# set to None if id_utilisateur_courant (nullable) is None
|
|
135
|
-
# and model_fields_set contains the field
|
|
136
|
-
if self.id_utilisateur_courant is None and "id_utilisateur_courant" in self.model_fields_set:
|
|
137
|
-
_dict['idUtilisateurCourant'] = None
|
|
138
|
-
|
|
139
|
-
# set to None if pieces_jointes_complementaires (nullable) is None
|
|
140
|
-
# and model_fields_set contains the field
|
|
141
|
-
if self.pieces_jointes_complementaires is None and "pieces_jointes_complementaires" in self.model_fields_set:
|
|
142
|
-
_dict['piecesJointesComplementaires'] = None
|
|
143
|
-
|
|
144
|
-
return _dict
|
|
145
|
-
|
|
146
|
-
@classmethod
|
|
147
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
148
|
-
"""Create an instance of FactureFacturX from a dict"""
|
|
149
|
-
if obj is None:
|
|
150
|
-
return None
|
|
151
|
-
|
|
152
|
-
if not isinstance(obj, dict):
|
|
153
|
-
return cls.model_validate(obj)
|
|
154
|
-
|
|
155
|
-
_obj = cls.model_validate({
|
|
156
|
-
"numeroFacture": obj.get("numeroFacture"),
|
|
157
|
-
"dateEcheancePaiement": obj.get("dateEcheancePaiement"),
|
|
158
|
-
"dateFacture": obj.get("dateFacture"),
|
|
159
|
-
"modeDepot": obj.get("modeDepot"),
|
|
160
|
-
"destinataire": Destinataire.from_dict(obj["destinataire"]) if obj.get("destinataire") is not None else None,
|
|
161
|
-
"fournisseur": Fournisseur.from_dict(obj["fournisseur"]) if obj.get("fournisseur") is not None else None,
|
|
162
|
-
"cadreDeFacturation": CadreDeFacturation.from_dict(obj["cadreDeFacturation"]) if obj.get("cadreDeFacturation") is not None else None,
|
|
163
|
-
"references": References.from_dict(obj["references"]) if obj.get("references") is not None else None,
|
|
164
|
-
"montantTotal": MontantTotal.from_dict(obj["montantTotal"]) if obj.get("montantTotal") is not None else None,
|
|
165
|
-
"lignesDePoste": [LigneDePoste.from_dict(_item) for _item in obj["lignesDePoste"]] if obj.get("lignesDePoste") is not None else None,
|
|
166
|
-
"lignesDeTva": [LigneDeTVA.from_dict(_item) for _item in obj["lignesDeTva"]] if obj.get("lignesDeTva") is not None else None,
|
|
167
|
-
"commentaire": obj.get("commentaire"),
|
|
168
|
-
"idUtilisateurCourant": obj.get("idUtilisateurCourant"),
|
|
169
|
-
"piecesJointesComplementaires": [PieceJointeComplementaire.from_dict(_item) for _item in obj["piecesJointesComplementaires"]] if obj.get("piecesJointesComplementaires") is not None else None
|
|
170
|
-
})
|
|
171
|
-
return _obj
|
|
172
|
-
|
|
173
|
-
|
factpulse/models/flux_resume.py
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : https://www.factpulse.fr/documentation-api/
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.0
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import pprint
|
|
17
|
-
import re # noqa: F401
|
|
18
|
-
import json
|
|
19
|
-
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from typing import Optional, Set
|
|
23
|
-
from typing_extensions import Self
|
|
24
|
-
|
|
25
|
-
class FluxResume(BaseModel):
|
|
26
|
-
"""
|
|
27
|
-
Résumé d'un flux dans les résultats de recherche
|
|
28
|
-
""" # noqa: E501
|
|
29
|
-
flow_id: StrictStr
|
|
30
|
-
tracking_id: Optional[StrictStr] = None
|
|
31
|
-
nom: StrictStr
|
|
32
|
-
type_flux: Optional[StrictStr] = None
|
|
33
|
-
direction_flux: Optional[StrictStr] = None
|
|
34
|
-
statut_acquittement: Optional[StrictStr] = None
|
|
35
|
-
date_creation: Optional[StrictStr] = None
|
|
36
|
-
date_maj: Optional[StrictStr] = None
|
|
37
|
-
__properties: ClassVar[List[str]] = ["flow_id", "tracking_id", "nom", "type_flux", "direction_flux", "statut_acquittement", "date_creation", "date_maj"]
|
|
38
|
-
|
|
39
|
-
model_config = ConfigDict(
|
|
40
|
-
populate_by_name=True,
|
|
41
|
-
validate_assignment=True,
|
|
42
|
-
protected_namespaces=(),
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def to_str(self) -> str:
|
|
47
|
-
"""Returns the string representation of the model using alias"""
|
|
48
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
49
|
-
|
|
50
|
-
def to_json(self) -> str:
|
|
51
|
-
"""Returns the JSON representation of the model using alias"""
|
|
52
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
53
|
-
return json.dumps(self.to_dict())
|
|
54
|
-
|
|
55
|
-
@classmethod
|
|
56
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
57
|
-
"""Create an instance of FluxResume from a JSON string"""
|
|
58
|
-
return cls.from_dict(json.loads(json_str))
|
|
59
|
-
|
|
60
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
61
|
-
"""Return the dictionary representation of the model using alias.
|
|
62
|
-
|
|
63
|
-
This has the following differences from calling pydantic's
|
|
64
|
-
`self.model_dump(by_alias=True)`:
|
|
65
|
-
|
|
66
|
-
* `None` is only added to the output dict for nullable fields that
|
|
67
|
-
were set at model initialization. Other fields with value `None`
|
|
68
|
-
are ignored.
|
|
69
|
-
"""
|
|
70
|
-
excluded_fields: Set[str] = set([
|
|
71
|
-
])
|
|
72
|
-
|
|
73
|
-
_dict = self.model_dump(
|
|
74
|
-
by_alias=True,
|
|
75
|
-
exclude=excluded_fields,
|
|
76
|
-
exclude_none=True,
|
|
77
|
-
)
|
|
78
|
-
# set to None if tracking_id (nullable) is None
|
|
79
|
-
# and model_fields_set contains the field
|
|
80
|
-
if self.tracking_id is None and "tracking_id" in self.model_fields_set:
|
|
81
|
-
_dict['tracking_id'] = None
|
|
82
|
-
|
|
83
|
-
# set to None if type_flux (nullable) is None
|
|
84
|
-
# and model_fields_set contains the field
|
|
85
|
-
if self.type_flux is None and "type_flux" in self.model_fields_set:
|
|
86
|
-
_dict['type_flux'] = None
|
|
87
|
-
|
|
88
|
-
# set to None if direction_flux (nullable) is None
|
|
89
|
-
# and model_fields_set contains the field
|
|
90
|
-
if self.direction_flux is None and "direction_flux" in self.model_fields_set:
|
|
91
|
-
_dict['direction_flux'] = None
|
|
92
|
-
|
|
93
|
-
# set to None if statut_acquittement (nullable) is None
|
|
94
|
-
# and model_fields_set contains the field
|
|
95
|
-
if self.statut_acquittement is None and "statut_acquittement" in self.model_fields_set:
|
|
96
|
-
_dict['statut_acquittement'] = None
|
|
97
|
-
|
|
98
|
-
# set to None if date_creation (nullable) is None
|
|
99
|
-
# and model_fields_set contains the field
|
|
100
|
-
if self.date_creation is None and "date_creation" in self.model_fields_set:
|
|
101
|
-
_dict['date_creation'] = None
|
|
102
|
-
|
|
103
|
-
# set to None if date_maj (nullable) is None
|
|
104
|
-
# and model_fields_set contains the field
|
|
105
|
-
if self.date_maj is None and "date_maj" in self.model_fields_set:
|
|
106
|
-
_dict['date_maj'] = None
|
|
107
|
-
|
|
108
|
-
return _dict
|
|
109
|
-
|
|
110
|
-
@classmethod
|
|
111
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
112
|
-
"""Create an instance of FluxResume from a dict"""
|
|
113
|
-
if obj is None:
|
|
114
|
-
return None
|
|
115
|
-
|
|
116
|
-
if not isinstance(obj, dict):
|
|
117
|
-
return cls.model_validate(obj)
|
|
118
|
-
|
|
119
|
-
_obj = cls.model_validate({
|
|
120
|
-
"flow_id": obj.get("flow_id"),
|
|
121
|
-
"tracking_id": obj.get("tracking_id"),
|
|
122
|
-
"nom": obj.get("nom"),
|
|
123
|
-
"type_flux": obj.get("type_flux"),
|
|
124
|
-
"direction_flux": obj.get("direction_flux"),
|
|
125
|
-
"statut_acquittement": obj.get("statut_acquittement"),
|
|
126
|
-
"date_creation": obj.get("date_creation"),
|
|
127
|
-
"date_maj": obj.get("date_maj")
|
|
128
|
-
})
|
|
129
|
-
return _obj
|
|
130
|
-
|
|
131
|
-
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : https://www.factpulse.fr/documentation-api/
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.0
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import json
|
|
17
|
-
from enum import Enum
|
|
18
|
-
from typing_extensions import Self
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class FormatSortie(str, Enum):
|
|
22
|
-
"""
|
|
23
|
-
FormatSortie
|
|
24
|
-
"""
|
|
25
|
-
|
|
26
|
-
"""
|
|
27
|
-
allowed enum values
|
|
28
|
-
"""
|
|
29
|
-
XML = 'xml'
|
|
30
|
-
PDF = 'pdf'
|
|
31
|
-
|
|
32
|
-
@classmethod
|
|
33
|
-
def from_json(cls, json_str: str) -> Self:
|
|
34
|
-
"""Create an instance of FormatSortie from a JSON string"""
|
|
35
|
-
return cls(json.loads(json_str))
|
|
36
|
-
|
|
37
|
-
|
factpulse/models/fournisseur.py
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : https://www.factpulse.fr/documentation-api/
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.0
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import pprint
|
|
17
|
-
import re # noqa: F401
|
|
18
|
-
import json
|
|
19
|
-
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from factpulse.models.adresse_electronique import AdresseElectronique
|
|
23
|
-
from factpulse.models.adresse_postale import AdressePostale
|
|
24
|
-
from typing import Optional, Set
|
|
25
|
-
from typing_extensions import Self
|
|
26
|
-
|
|
27
|
-
class Fournisseur(BaseModel):
|
|
28
|
-
"""
|
|
29
|
-
Informations sur le fournisseur qui émet la facture.
|
|
30
|
-
""" # noqa: E501
|
|
31
|
-
adresse_electronique: AdresseElectronique = Field(alias="adresseElectronique")
|
|
32
|
-
id_fournisseur: StrictInt = Field(alias="idFournisseur")
|
|
33
|
-
code_coordonnees_bancaires_fournisseur: Optional[StrictInt] = Field(default=None, alias="codeCoordonneesBancairesFournisseur")
|
|
34
|
-
id_service_fournisseur: Optional[StrictInt] = Field(default=None, alias="idServiceFournisseur")
|
|
35
|
-
nom: Optional[StrictStr] = None
|
|
36
|
-
siret: Optional[StrictStr] = None
|
|
37
|
-
numero_tva_intra: Optional[StrictStr] = Field(default=None, alias="numeroTvaIntra")
|
|
38
|
-
iban: Optional[StrictStr] = None
|
|
39
|
-
adresse_postale: Optional[AdressePostale] = Field(default=None, alias="adressePostale")
|
|
40
|
-
__properties: ClassVar[List[str]] = ["adresseElectronique", "idFournisseur", "codeCoordonneesBancairesFournisseur", "idServiceFournisseur", "nom", "siret", "numeroTvaIntra", "iban", "adressePostale"]
|
|
41
|
-
|
|
42
|
-
model_config = ConfigDict(
|
|
43
|
-
populate_by_name=True,
|
|
44
|
-
validate_assignment=True,
|
|
45
|
-
protected_namespaces=(),
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def to_str(self) -> str:
|
|
50
|
-
"""Returns the string representation of the model using alias"""
|
|
51
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
52
|
-
|
|
53
|
-
def to_json(self) -> str:
|
|
54
|
-
"""Returns the JSON representation of the model using alias"""
|
|
55
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
56
|
-
return json.dumps(self.to_dict())
|
|
57
|
-
|
|
58
|
-
@classmethod
|
|
59
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
-
"""Create an instance of Fournisseur from a JSON string"""
|
|
61
|
-
return cls.from_dict(json.loads(json_str))
|
|
62
|
-
|
|
63
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
-
"""Return the dictionary representation of the model using alias.
|
|
65
|
-
|
|
66
|
-
This has the following differences from calling pydantic's
|
|
67
|
-
`self.model_dump(by_alias=True)`:
|
|
68
|
-
|
|
69
|
-
* `None` is only added to the output dict for nullable fields that
|
|
70
|
-
were set at model initialization. Other fields with value `None`
|
|
71
|
-
are ignored.
|
|
72
|
-
"""
|
|
73
|
-
excluded_fields: Set[str] = set([
|
|
74
|
-
])
|
|
75
|
-
|
|
76
|
-
_dict = self.model_dump(
|
|
77
|
-
by_alias=True,
|
|
78
|
-
exclude=excluded_fields,
|
|
79
|
-
exclude_none=True,
|
|
80
|
-
)
|
|
81
|
-
# override the default output from pydantic by calling `to_dict()` of adresse_electronique
|
|
82
|
-
if self.adresse_electronique:
|
|
83
|
-
_dict['adresseElectronique'] = self.adresse_electronique.to_dict()
|
|
84
|
-
# override the default output from pydantic by calling `to_dict()` of adresse_postale
|
|
85
|
-
if self.adresse_postale:
|
|
86
|
-
_dict['adressePostale'] = self.adresse_postale.to_dict()
|
|
87
|
-
# set to None if code_coordonnees_bancaires_fournisseur (nullable) is None
|
|
88
|
-
# and model_fields_set contains the field
|
|
89
|
-
if self.code_coordonnees_bancaires_fournisseur is None and "code_coordonnees_bancaires_fournisseur" in self.model_fields_set:
|
|
90
|
-
_dict['codeCoordonneesBancairesFournisseur'] = None
|
|
91
|
-
|
|
92
|
-
# set to None if id_service_fournisseur (nullable) is None
|
|
93
|
-
# and model_fields_set contains the field
|
|
94
|
-
if self.id_service_fournisseur is None and "id_service_fournisseur" in self.model_fields_set:
|
|
95
|
-
_dict['idServiceFournisseur'] = None
|
|
96
|
-
|
|
97
|
-
# set to None if nom (nullable) is None
|
|
98
|
-
# and model_fields_set contains the field
|
|
99
|
-
if self.nom is None and "nom" in self.model_fields_set:
|
|
100
|
-
_dict['nom'] = None
|
|
101
|
-
|
|
102
|
-
# set to None if siret (nullable) is None
|
|
103
|
-
# and model_fields_set contains the field
|
|
104
|
-
if self.siret is None and "siret" in self.model_fields_set:
|
|
105
|
-
_dict['siret'] = None
|
|
106
|
-
|
|
107
|
-
# set to None if numero_tva_intra (nullable) is None
|
|
108
|
-
# and model_fields_set contains the field
|
|
109
|
-
if self.numero_tva_intra is None and "numero_tva_intra" in self.model_fields_set:
|
|
110
|
-
_dict['numeroTvaIntra'] = None
|
|
111
|
-
|
|
112
|
-
# set to None if iban (nullable) is None
|
|
113
|
-
# and model_fields_set contains the field
|
|
114
|
-
if self.iban is None and "iban" in self.model_fields_set:
|
|
115
|
-
_dict['iban'] = None
|
|
116
|
-
|
|
117
|
-
# set to None if adresse_postale (nullable) is None
|
|
118
|
-
# and model_fields_set contains the field
|
|
119
|
-
if self.adresse_postale is None and "adresse_postale" in self.model_fields_set:
|
|
120
|
-
_dict['adressePostale'] = None
|
|
121
|
-
|
|
122
|
-
return _dict
|
|
123
|
-
|
|
124
|
-
@classmethod
|
|
125
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
126
|
-
"""Create an instance of Fournisseur from a dict"""
|
|
127
|
-
if obj is None:
|
|
128
|
-
return None
|
|
129
|
-
|
|
130
|
-
if not isinstance(obj, dict):
|
|
131
|
-
return cls.model_validate(obj)
|
|
132
|
-
|
|
133
|
-
_obj = cls.model_validate({
|
|
134
|
-
"adresseElectronique": AdresseElectronique.from_dict(obj["adresseElectronique"]) if obj.get("adresseElectronique") is not None else None,
|
|
135
|
-
"idFournisseur": obj.get("idFournisseur"),
|
|
136
|
-
"codeCoordonneesBancairesFournisseur": obj.get("codeCoordonneesBancairesFournisseur"),
|
|
137
|
-
"idServiceFournisseur": obj.get("idServiceFournisseur"),
|
|
138
|
-
"nom": obj.get("nom"),
|
|
139
|
-
"siret": obj.get("siret"),
|
|
140
|
-
"numeroTvaIntra": obj.get("numeroTvaIntra"),
|
|
141
|
-
"iban": obj.get("iban"),
|
|
142
|
-
"adressePostale": AdressePostale.from_dict(obj["adressePostale"]) if obj.get("adressePostale") is not None else None
|
|
143
|
-
})
|
|
144
|
-
return _obj
|
|
145
|
-
|
|
146
|
-
|