feat(upload): חסימת כפילות בהעלאת פסיקה + banner עם אפשרויות
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m38s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m38s
- בקאנד: GET לפני ה-async task — אם citation כבר קיים כ-external_upload מחזיר 409 - DB: get_external_case_law_by_citation — lookup לפי citation + source_kind - פרונט: banner אדום עם פרטי הרשומה הקיימת ושני כפתורות: • "הפעל חילוץ מחדש" — request-halachot ל-ID הקיים וסגירת הטופס • "מחק את הרשומה" — DELETE עם confirm, ניקוי conflict לאחר מכן Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2615,6 +2615,23 @@ async def get_case_law(case_law_id: UUID) -> dict | None:
|
||||
return _row_to_case_law(row) if row else None
|
||||
|
||||
|
||||
async def get_external_case_law_by_citation(citation: str) -> dict | None:
|
||||
"""Return the first external_upload row whose case_number matches citation, or None."""
|
||||
pool = await get_pool()
|
||||
row = await pool.fetchrow(
|
||||
"""
|
||||
SELECT id, case_number, case_name, court, date,
|
||||
halacha_extraction_status, source_kind, created_at
|
||||
FROM case_law
|
||||
WHERE case_number = $1
|
||||
AND source_kind = 'external_upload'
|
||||
LIMIT 1
|
||||
""",
|
||||
citation,
|
||||
)
|
||||
return _row_to_case_law(row) if row else None
|
||||
|
||||
|
||||
async def mark_indexed(case_law_id: UUID) -> None:
|
||||
"""Mark a case_law row's embeddings as built from its current content (FU-3).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user