Merge pull request 'feat(plans): משיכת תב"ע מ-מנהל-התכנון (mavat) — Phase C backend-slice' (#292) from worktree-plan-fetch-mavat into main
This commit was merged in pull request #292.
This commit is contained in:
26
web/app.py
26
web/app.py
@@ -7653,6 +7653,32 @@ async def plan_merge(req: PlanMergeRequest):
|
||||
raise HTTPException(400, str(e))
|
||||
|
||||
|
||||
class PlanFetchRequest(BaseModel):
|
||||
plan_number: str
|
||||
|
||||
|
||||
@app.post("/api/plans/fetch")
|
||||
async def plan_fetch_from_mavat(req: PlanFetchRequest):
|
||||
"""Pull a plan's identity + validity from mavat (מנהל התכנון) for the chair form.
|
||||
|
||||
Returns a candidate dict (display_name/plan_type/purpose/gazette_date/
|
||||
yalkut_number/source_url) — does NOT write the registry; the chair saves via
|
||||
POST /api/plans (review_status gate stays, INV-AH source_url carried). The
|
||||
browser work runs on the host bridge (Camoufox past F5); 503 if it's down,
|
||||
404 if the plan wasn't found.
|
||||
"""
|
||||
from legal_mcp.services import plans_fetch
|
||||
|
||||
if not req.plan_number.strip():
|
||||
raise HTTPException(400, "חסר מספר-תכנית")
|
||||
try:
|
||||
return await plans_fetch.fetch_plan(req.plan_number)
|
||||
except plans_fetch.PlanFetchUnavailable as e:
|
||||
raise HTTPException(503, str(e))
|
||||
except plans_fetch.PlanFetchError as e:
|
||||
raise HTTPException(404, str(e))
|
||||
|
||||
|
||||
# ── Missing Precedents (TaskMaster #35) ────────────────────────────
|
||||
# Track citations from party briefs that aren't yet in the precedent
|
||||
# corpus. Researcher logs gaps; chair closes them by uploading the
|
||||
|
||||
Reference in New Issue
Block a user