Files
fund-tracer/backend/app/schemas/image.py

41 lines
774 B
Python
Raw Normal View History

2026-03-11 16:28:04 +08:00
from datetime import datetime
from uuid import UUID
from app.models.evidence_image import SourceApp, PageType, OcrStatus
2026-03-12 12:32:29 +08:00
from app.schemas.base import CamelModel
2026-03-11 16:28:04 +08:00
2026-03-12 12:32:29 +08:00
class ImageOut(CamelModel):
2026-03-11 16:28:04 +08:00
id: UUID
case_id: UUID
url: str = ""
thumb_url: str = ""
source_app: SourceApp
page_type: PageType
ocr_status: OcrStatus
file_hash: str
uploaded_at: datetime
2026-03-12 12:32:29 +08:00
class OcrBlockOut(CamelModel):
2026-03-11 16:28:04 +08:00
id: UUID
content: str
bbox: dict
seq_order: int
confidence: float
class ImageDetailOut(ImageOut):
ocr_blocks: list[OcrBlockOut] = []
2026-03-12 12:32:29 +08:00
class OcrFieldCorrection(CamelModel):
2026-03-11 16:28:04 +08:00
field_name: str
old_value: str
new_value: str
2026-03-12 12:32:29 +08:00
class CaseOcrStartIn(CamelModel):
include_done: bool = False
image_ids: list[UUID] = []