29202325a6
- Backend: ContactFolder model (hierarchisch, parent_id, sort_order)
- Migration 0022: contact_folders Tabelle + folder_id FK auf contacts
- CRUD Routes: /api/v1/contact-folders (list, create, update, delete, reorder)
- Move Contact API: /api/v1/contact-folders/contacts/{id}/move
- folder_id Filter in contacts list API
- Frontend: ContactFolderTree mit Baum-Struktur, Drag&Drop, Kontext-Menü
- Kontakt-Personen-Icon statt Ordner-Symbol
- ContactList Items draggable (List/Table/Cards View)
- React Query Hooks für Folder CRUD + Move Contact
- Alle 266 Frontend-Tests passing
34 lines
826 B
Python
34 lines
826 B
Python
"""Contact folder schemas — CRUD for hierarchical contact folders."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class ContactFolderCreate(BaseModel):
|
|
name: str = Field(..., min_length=1, max_length=255)
|
|
parent_id: str | None = None
|
|
|
|
|
|
class ContactFolderUpdate(BaseModel):
|
|
name: str | None = Field(None, min_length=1, max_length=255)
|
|
parent_id: str | None = None
|
|
sort_order: int | None = None
|
|
|
|
|
|
class ContactFolderResponse(BaseModel):
|
|
id: str
|
|
name: str
|
|
parent_id: str | None = None
|
|
user_id: str
|
|
sort_order: int = 0
|
|
|
|
|
|
class ContactFolderTreeResponse(ContactFolderResponse):
|
|
children: list["ContactFolderTreeResponse"] = Field(default_factory=list)
|
|
contact_count: int = 0
|
|
|
|
|
|
class MoveContactRequest(BaseModel):
|
|
folder_id: str | None = None
|