fix(#77 backend): editable case_number + separate citation field on committee upload #40

Merged
chaim merged 1 commits from fix/77-precedent-identity-backend into main 2026-06-02 12:10:00 +00:00
Owner

חלק 1/2 של #77 (backend). חלק 2 (frontend: שדה "מספר תיק" נפרד בהעלאה + עריכה) יבוא אחרי api:types.

תיקונים

  1. PrecedentUpdateRequest += case_number — המזהה הקנוני לא היה במודל העריכה, אז מזהה שגוי שנקלט בהעלאה (כמו המראה-מקום המלא) לא היה ניתן לתיקון. update_case_law כבר מתיר אותו.
  2. /api/internal-decisions/upload += שדה citationcase_number עכשיו המזהה הנקי (8027-25) ו-citation הוא המראה-מקום המלא, מאוחסן כ-citation_formatted מראש (קודם ה-UI שלח את המראה-מקום בתור case_number). מאוחסן דרך update_case_law אחרי ה-ingest, לא ב-INSERT הליבה.

🤖 Generated with Claude Code

חלק 1/2 של #77 (backend). חלק 2 (frontend: שדה "מספר תיק" נפרד בהעלאה + עריכה) יבוא אחרי `api:types`. ## תיקונים 1. **`PrecedentUpdateRequest` += `case_number`** — המזהה הקנוני לא היה במודל העריכה, אז מזהה שגוי שנקלט בהעלאה (כמו המראה-מקום המלא) לא היה ניתן לתיקון. `update_case_law` כבר מתיר אותו. 2. **`/api/internal-decisions/upload` += שדה `citation`** — `case_number` עכשיו המזהה הנקי (8027-25) ו-`citation` הוא המראה-מקום המלא, מאוחסן כ-`citation_formatted` מראש (קודם ה-UI שלח את המראה-מקום *בתור* case_number). מאוחסן דרך `update_case_law` אחרי ה-ingest, לא ב-INSERT הליבה. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chaim added 1 commit 2026-06-02 12:09:54 +00:00
Two identity fixes for the precedent corpus:
1. PrecedentUpdateRequest += case_number — the canonical identifier was not
   in the edit model, so a wrong id captured at upload (e.g. the full
   citation pasted into the field) could not be corrected. update_case_law
   already whitelists case_number.
2. /api/internal-decisions/upload += citation form field — case_number is
   now the clean identifier (e.g. 8027-25) and citation is the full
   מראה-מקום, stored as citation_formatted up-front (previously the UI sent
   the citation AS case_number, leaving the id polluted and citation_formatted
   empty until extraction). Stored via a post-ingest update_case_law, not the
   core INSERT.

Frontend (separate case_number field in the upload + edit sheets) follows in
a second PR after api:types regen.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chaim merged commit 9295e74762 into main 2026-06-02 12:10:00 +00:00
chaim deleted branch fix/77-precedent-identity-backend 2026-06-02 12:10:00 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ezer-mishpati/legal-ai#40