Merge pull request 'feat(learning): אינדיקציית-תיק למצב למידת-קול + חילוץ-הלכות אחרי החלטה סופית' (#233) from worktree-case-learning-indicator into main
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m39s
G12 Leak-Guard / leak-guard (push) Successful in 9s

This commit was merged in pull request #233.
This commit is contained in:
2026-06-12 10:51:18 +00:00
7 changed files with 461 additions and 9 deletions

View File

@@ -3764,6 +3764,19 @@ async def api_final_run_halacha(case_number: str):
return await _wake_final_task(case_number, "halacha")
@app.get("/api/cases/{case_number}/learning-status")
async def api_case_learning_status(case_number: str):
"""Derived status of the two post-final pipelines (voice learning + halacha
extraction) for the case: whether each ran, succeeded, why not, and how many
halachot were extracted. Focused/cheap endpoint for the UI to poll + invalidate
after the run-learning/run-halacha buttons. Same derivation as case_get's
learning_status (single source — db.case_learning_status)."""
case = await db.get_case_by_number(case_number)
if not case:
raise HTTPException(404, f"תיק {case_number} לא נמצא")
return await db.case_learning_status(case)
@app.post("/api/cases/{case_number}/export-docx")
async def api_export_docx(case_number: str, background_tasks: BackgroundTasks):
"""Trigger DOCX export for a case.