18295e8e4f
Each document's tags are now editable inline: click Edit to enter a tag editor (Enter/comma to add, × to remove, Save to persist). The View button opens the PDF in a new browser tab via blob URL. Both features work through the existing proxy — no proxy changes needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
44 lines
902 B
Python
44 lines
902 B
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class CategoryOut(BaseModel):
|
|
id: str
|
|
name: str
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class DocumentOut(BaseModel):
|
|
id: str
|
|
user_id: str
|
|
filename: str
|
|
file_size: int
|
|
status: str
|
|
document_type: str | None
|
|
extracted_data: str | None # JSON string — frontend calls JSON.parse()
|
|
tags: str | None # JSON array string
|
|
error_message: str | None
|
|
created_at: datetime
|
|
processed_at: datetime | None
|
|
categories: list[CategoryOut] = []
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class DocumentStatusOut(BaseModel):
|
|
id: str
|
|
status: str
|
|
error_message: str | None
|
|
processed_at: datetime | None
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class DocumentTypeUpdate(BaseModel):
|
|
document_type: str
|
|
|
|
|
|
class TagsUpdate(BaseModel):
|
|
tags: list[str]
|