refactor(api): update endpoint tags for better organization

This commit is contained in:
Fanilo-Nantenaina 2025-12-08 11:03:30 +03:00
parent fafd5222a6
commit 14b2758b68

24
api.py
View file

@ -1410,7 +1410,7 @@ async def lister_commandes(
raise HTTPException(500, str(e)) 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)): async def devis_vers_commande(id: str, session: AsyncSession = Depends(get_session)):
""" """
🔧 Transformation Devis Commande 🔧 Transformation Devis Commande
@ -1465,7 +1465,7 @@ async def devis_vers_commande(id: str, session: AsyncSession = Depends(get_sessi
raise HTTPException(500, str(e)) 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)): async def commande_vers_facture(id: str, session: AsyncSession = Depends(get_session)):
""" """
🔧 Transformation Commande Facture 🔧 Transformation Commande Facture
@ -1511,7 +1511,7 @@ async def commande_vers_facture(id: str, session: AsyncSession = Depends(get_ses
# ===================================================== # =====================================================
# ENDPOINTS - US-A3 (SIGNATURE ÉLECTRONIQUE) # ENDPOINTS - US-A3 (SIGNATURE ÉLECTRONIQUE)
# ===================================================== # =====================================================
@app.post("/signature/universign/send", tags=["Universign"]) @app.post("/signature/universign/send", tags=["Signatures"])
async def envoyer_signature( async def envoyer_signature(
demande: SignatureRequest, session: AsyncSession = Depends(get_session) demande: SignatureRequest, session: AsyncSession = Depends(get_session)
): ):
@ -1564,7 +1564,7 @@ async def envoyer_signature(
raise HTTPException(500, str(e)) 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(...)): async def statut_signature(docId: str = Query(...)):
"""🔍 Récupération du statut de signature en temps réel""" """🔍 Récupération du statut de signature en temps réel"""
# Chercher dans la DB locale # Chercher dans la DB locale
@ -1592,7 +1592,7 @@ async def statut_signature(docId: str = Query(...)):
raise HTTPException(500, str(e)) raise HTTPException(500, str(e))
@app.get("/signatures", tags=["Universign"]) @app.get("/signatures", tags=["Signatures"])
async def lister_signatures( async def lister_signatures(
statut: Optional[StatutSignature] = Query(None), statut: Optional[StatutSignature] = Query(None),
limit: int = Query(100, le=1000), 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( async def statut_signature_detail(
transaction_id: str, session: AsyncSession = Depends(get_session) 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)): async def rafraichir_statuts_signatures(session: AsyncSession = Depends(get_session)):
"""🔄 Rafraîchit TOUS les statuts des signatures en attente""" """🔄 Rafraîchit TOUS les statuts des signatures en attente"""
query = select(SignatureLog).where( query = select(SignatureLog).where(
@ -1802,7 +1802,7 @@ class EmailBatchRequest(BaseModel):
type_document: Optional[TypeDocument] = None 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( async def envoyer_emails_lot(
batch: EmailBatchRequest, session: AsyncSession = Depends(get_session) 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( async def valider_remise(
client_id: str = Query(..., min_length=1), client_id: str = Query(..., min_length=1),
remise_pourcentage: float = Query(0.0, ge=0, le=100), remise_pourcentage: float = Query(0.0, ge=0, le=100),
@ -3195,7 +3195,7 @@ async def modifier_livraison(
raise HTTPException(500, str(e)) 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)): async def livraison_vers_facture(id: str, session: AsyncSession = Depends(get_session)):
""" """
🔧 Transformation Livraison Facture 🔧 Transformation Livraison Facture
@ -3238,7 +3238,7 @@ async def livraison_vers_facture(id: str, session: AsyncSession = Depends(get_se
raise HTTPException(500, str(e)) 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)): async def devis_vers_facture_direct(id: str, session: AsyncSession = Depends(get_session)):
""" """
🔧 Transformation Devis Facture (DIRECT, sans commande) 🔧 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)) 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)): async def commande_vers_livraison(id: str, session: AsyncSession = Depends(get_session)):
""" """
🔧 Transformation Commande Bon de livraison 🔧 Transformation Commande Bon de livraison