Phase 1 MVP - Complete implementation
- Auth: register, login, JWT with refresh tokens, blocklist - Projects/Folders/Documents CRUD with soft deletes - Tags CRUD and assignment - FTS5 search with highlights and tag filtering - ADR-001, ADR-002, ADR-003 compliant - Security fixes applied (JWT_SECRET_KEY, exception handler, cookie secure) - 25 tests passing
This commit is contained in:
58
app/schemas/document.py
Normal file
58
app/schemas/document.py
Normal file
@@ -0,0 +1,58 @@
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class DocumentCreate(BaseModel):
|
||||
title: str
|
||||
content: str = ""
|
||||
folder_id: str | None = None
|
||||
|
||||
|
||||
class DocumentUpdate(BaseModel):
|
||||
title: str | None = None
|
||||
folder_id: str | None = None
|
||||
|
||||
|
||||
class DocumentContentUpdate(BaseModel):
|
||||
content: str = Field(..., max_length=1_000_000) # 1MB limit
|
||||
|
||||
|
||||
class TagInfo(BaseModel):
|
||||
id: str
|
||||
name: str
|
||||
color: str
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class DocumentResponse(BaseModel):
|
||||
id: str
|
||||
title: str
|
||||
content: str
|
||||
project_id: str
|
||||
folder_id: str | None
|
||||
path: str
|
||||
tags: list[TagInfo] = []
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class DocumentListResponse(BaseModel):
|
||||
documents: list[DocumentResponse]
|
||||
|
||||
|
||||
class DocumentBriefResponse(BaseModel):
|
||||
"""Brief document for list views without content."""
|
||||
id: str
|
||||
title: str
|
||||
project_id: str
|
||||
folder_id: str | None
|
||||
path: str
|
||||
tags: list[TagInfo] = []
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
Reference in New Issue
Block a user