feat(proceeding-type): explicit ערר/בל"מ field for cases + corpus
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m40s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m40s
Same case_number can exist as both a regular appeal (ערר) and an extension-of-time request (בל"מ), and we were inferring the difference from appeal_subtype prefixes — fragile, and case-number lookups weren't disambiguated. Now stored as a first-class field on both case_law (corpus) and cases (live cases), with partial unique indexes on (case_number, proceeding_type). - SCHEMA_V15: column + CHECK constraints + backfill from appeal_subtype LIKE 'extension_request_%' + partial unique indexes replace the old global UNIQUE(case_number). - derive_proceeding_type() centralizes the inference rule (extension_request_* → בל"מ; subject regex fallback; default ערר). - Metadata extractor prompt asks Claude to populate the new field explicitly; apply_to_record writes it for internal_committee rows. - internal_decision_upload, case_create, case_update accept an optional proceeding_type; FastAPI request models expose it. - Wizard + edit dialog get a sided Select; case header renders the resolved label (ערר / בל"מ). - Uploaded the 2 staged בל"מ decisions on betterment levy: 8126/24 (סופר נוח, 13 chunks), 8047/23 (הרנון, 48 chunks). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1234,6 +1234,9 @@ class CaseCreateRequest(BaseModel):
|
||||
# send a domain value explicitly.
|
||||
practice_area: str = ""
|
||||
appeal_subtype: str = ""
|
||||
# proceeding_type: 'ערר' / 'בל"מ'. Empty → auto-derived from
|
||||
# appeal_subtype / subject downstream.
|
||||
proceeding_type: str = ""
|
||||
|
||||
|
||||
class CaseUpdateRequest(BaseModel):
|
||||
@@ -1249,6 +1252,7 @@ class CaseUpdateRequest(BaseModel):
|
||||
respondents: list[str] | None = None
|
||||
property_address: str = ""
|
||||
permit_number: str = ""
|
||||
proceeding_type: str = ""
|
||||
|
||||
|
||||
@app.post("/api/cases/create")
|
||||
@@ -1268,6 +1272,7 @@ async def api_case_create(req: CaseCreateRequest):
|
||||
expected_outcome=req.expected_outcome,
|
||||
practice_area=req.practice_area,
|
||||
appeal_subtype=req.appeal_subtype,
|
||||
proceeding_type=req.proceeding_type,
|
||||
)
|
||||
parsed = json.loads(result)
|
||||
|
||||
@@ -1399,6 +1404,7 @@ async def api_case_update(case_number: str, req: CaseUpdateRequest, background_t
|
||||
respondents=req.respondents,
|
||||
property_address=req.property_address,
|
||||
permit_number=req.permit_number,
|
||||
proceeding_type=req.proceeding_type,
|
||||
)
|
||||
except ValueError as exc:
|
||||
raise HTTPException(422, str(exc))
|
||||
|
||||
Reference in New Issue
Block a user