feat(api): add endpoint to fetch bank journals
This commit is contained in:
parent
25be0bd569
commit
cc1609549f
2 changed files with 13 additions and 0 deletions
10
api.py
10
api.py
|
|
@ -3106,6 +3106,16 @@ async def get_modes_reglement():
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/journaux/banque", tags=["Règlements"])
|
||||||
|
async def get_journaux_banque():
|
||||||
|
try:
|
||||||
|
resultat = sage_client.get_journaux_banque()
|
||||||
|
return {"success": True, "data": resultat}
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"Erreur lecture journaux: {e}")
|
||||||
|
raise HTTPException(500, str(e))
|
||||||
|
|
||||||
|
|
||||||
@app.get("/health", tags=["System"])
|
@app.get("/health", tags=["System"])
|
||||||
async def health_check(
|
async def health_check(
|
||||||
sage: SageGatewayClient = Depends(get_sage_client_for_user),
|
sage: SageGatewayClient = Depends(get_sage_client_for_user),
|
||||||
|
|
|
||||||
|
|
@ -505,6 +505,9 @@ class SageGatewayClient:
|
||||||
"data", {}
|
"data", {}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def get_journaux_banque(self) -> dict:
|
||||||
|
return self._get("/sage/journaux/banque").get("data", {})
|
||||||
|
|
||||||
def refresh_cache(self) -> Dict:
|
def refresh_cache(self) -> Dict:
|
||||||
return self._post("/sage/cache/refresh")
|
return self._post("/sage/cache/refresh")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue