cf5518c7ec
Closes the rule #8 gap at the API layer: PATCH endpoints + service updates for Tree (name/description/visibility), Source, Citation (page/detail/confidence), Relationship (qualifier/notes), and Media (title/attachment) — editor-gated and audited. Every core entity now has create/read/update/delete. Edit UIs for these land in the frontend batch. 37 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Justin Paul <justin@jpaul.me>
30 lines
628 B
Python
30 lines
628 B
Python
import uuid
|
|
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
from app.models.enums import TreeVisibility
|
|
|
|
|
|
class TreeCreate(BaseModel):
|
|
name: str
|
|
description: str | None = None
|
|
visibility: TreeVisibility = TreeVisibility.private
|
|
|
|
|
|
class TreeUpdate(BaseModel):
|
|
name: str | None = None
|
|
description: str | None = None
|
|
visibility: TreeVisibility | None = None
|
|
|
|
|
|
class TreeRead(BaseModel):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: uuid.UUID
|
|
name: str
|
|
description: str | None
|
|
visibility: TreeVisibility
|
|
owner_id: uuid.UUID
|
|
created_at: datetime
|