feat(api): add endpoint to read order with its lines
This commit is contained in:
parent
588ea6c4f4
commit
df5ed76ec6
1 changed files with 14 additions and 0 deletions
14
api.py
14
api.py
|
|
@ -550,6 +550,20 @@ async def changer_statut_devis(id: str, nouveau_statut: int = Query(..., ge=0, l
|
|||
# ENDPOINTS - US-A2 (WORKFLOW SANS RESSAISIE)
|
||||
# =====================================================
|
||||
|
||||
@app.get("/commandes/{id}", tags=["US-A2"])
|
||||
async def lire_commande(id: str):
|
||||
"""📄 Lecture d'une commande avec ses lignes"""
|
||||
try:
|
||||
commande = sage_client.lire_document(id, TypeDocument.BON_COMMANDE)
|
||||
if not commande:
|
||||
raise HTTPException(404, f"Commande {id} introuvable")
|
||||
return commande
|
||||
except HTTPException:
|
||||
raise
|
||||
except Exception as e:
|
||||
logger.error(f"Erreur lecture commande: {e}")
|
||||
raise HTTPException(500, str(e))
|
||||
|
||||
|
||||
@app.get("/commandes", tags=["US-A2"])
|
||||
async def lister_commandes(
|
||||
|
|
|
|||
Loading…
Reference in a new issue