From 14b2758b68ccae990ad1b89ea455df7b561aa9cb Mon Sep 17 00:00:00 2001 From: Fanilo-Nantenaina Date: Mon, 8 Dec 2025 11:03:30 +0300 Subject: [PATCH] refactor(api): update endpoint tags for better organization --- api.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/api.py b/api.py index bcc7bbb..0b37c3a 100644 --- a/api.py +++ b/api.py @@ -1410,7 +1410,7 @@ async def lister_commandes( raise HTTPException(500, str(e)) -@app.post("/workflow/devis/{id}/to-commande", tags=["US-A2"]) +@app.post("/workflow/devis/{id}/to-commande", tags=["Workflows"]) async def devis_vers_commande(id: str, session: AsyncSession = Depends(get_session)): """ 🔧 Transformation Devis → Commande @@ -1465,7 +1465,7 @@ async def devis_vers_commande(id: str, session: AsyncSession = Depends(get_sessi raise HTTPException(500, str(e)) -@app.post("/workflow/commande/{id}/to-facture", tags=["Commandes"]) +@app.post("/workflow/commande/{id}/to-facture", tags=["Workflows"]) async def commande_vers_facture(id: str, session: AsyncSession = Depends(get_session)): """ 🔧 Transformation Commande → Facture @@ -1511,7 +1511,7 @@ async def commande_vers_facture(id: str, session: AsyncSession = Depends(get_ses # ===================================================== # ENDPOINTS - US-A3 (SIGNATURE ÉLECTRONIQUE) # ===================================================== -@app.post("/signature/universign/send", tags=["Universign"]) +@app.post("/signature/universign/send", tags=["Signatures"]) async def envoyer_signature( demande: SignatureRequest, session: AsyncSession = Depends(get_session) ): @@ -1564,7 +1564,7 @@ async def envoyer_signature( raise HTTPException(500, str(e)) -@app.get("/signature/universign/status", tags=["Universign"]) +@app.get("/signature/universign/status", tags=["Signatures"]) async def statut_signature(docId: str = Query(...)): """🔍 Récupération du statut de signature en temps réel""" # Chercher dans la DB locale @@ -1592,7 +1592,7 @@ async def statut_signature(docId: str = Query(...)): raise HTTPException(500, str(e)) -@app.get("/signatures", tags=["Universign"]) +@app.get("/signatures", tags=["Signatures"]) async def lister_signatures( statut: Optional[StatutSignature] = Query(None), limit: int = Query(100, le=1000), @@ -1630,7 +1630,7 @@ async def lister_signatures( ] -@app.get("/signatures/{transaction_id}/status", tags=["Universign"]) +@app.get("/signatures/{transaction_id}/status", tags=["Signatures"]) async def statut_signature_detail( transaction_id: str, session: AsyncSession = Depends(get_session) ): @@ -1684,7 +1684,7 @@ async def statut_signature_detail( } -@app.post("/signatures/refresh-all", tags=["Universign"]) +@app.post("/signatures/refresh-all", tags=["Signatures"]) async def rafraichir_statuts_signatures(session: AsyncSession = Depends(get_session)): """🔄 Rafraîchit TOUS les statuts des signatures en attente""" query = select(SignatureLog).where( @@ -1802,7 +1802,7 @@ class EmailBatchRequest(BaseModel): type_document: Optional[TypeDocument] = None -@app.post("/emails/send-batch", tags=["US-A4"]) +@app.post("/emails/send-batch", tags=["Emails"]) async def envoyer_emails_lot( batch: EmailBatchRequest, session: AsyncSession = Depends(get_session) ): @@ -1856,7 +1856,7 @@ async def envoyer_emails_lot( # ===================================================== -@app.post("/devis/valider-remise", response_model=BaremeRemiseResponse, tags=["Devis"]) +@app.post("/devis/valider-remise", response_model=BaremeRemiseResponse, tags=["Validation"]) async def valider_remise( client_id: str = Query(..., min_length=1), remise_pourcentage: float = Query(0.0, ge=0, le=100), @@ -3195,7 +3195,7 @@ async def modifier_livraison( raise HTTPException(500, str(e)) -@app.post("/workflow/livraison/{id}/to-facture", tags=["US-A2"]) +@app.post("/workflow/livraison/{id}/to-facture", tags=["Workflows"]) async def livraison_vers_facture(id: str, session: AsyncSession = Depends(get_session)): """ 🔧 Transformation Livraison → Facture @@ -3238,7 +3238,7 @@ async def livraison_vers_facture(id: str, session: AsyncSession = Depends(get_se raise HTTPException(500, str(e)) -@app.post("/workflow/devis/{id}/to-facture", tags=["Devis"]) +@app.post("/workflow/devis/{id}/to-facture", tags=["Workflows"]) async def devis_vers_facture_direct(id: str, session: AsyncSession = Depends(get_session)): """ 🔧 Transformation Devis → Facture (DIRECT, sans commande) @@ -3325,7 +3325,7 @@ async def devis_vers_facture_direct(id: str, session: AsyncSession = Depends(get raise HTTPException(500, str(e)) -@app.post("/workflow/commande/{id}/to-livraison", tags=["Commandes"]) +@app.post("/workflow/commande/{id}/to-livraison", tags=["Workflows"]) async def commande_vers_livraison(id: str, session: AsyncSession = Depends(get_session)): """ 🔧 Transformation Commande → Bon de livraison