Initial commit: webmail client (M0/M1)
Three-pane webmail client. - Backend: FastAPI + async SQLAlchemy + arq worker (Postgres/Redis), IMAP/SMTP sync, threading, search, drafts/outbox with undo, attachments, 2FA. - Frontend: React 18 + Vite + TypeScript + TanStack Query + Tailwind; three-pane UI with rich-text composer, light/dark themes, resizable panels. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
"""Compose/draft/send request & response models (SPEC §9.1)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import uuid
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class DraftPayload(BaseModel):
|
||||
to: list[str] = []
|
||||
cc: list[str] = []
|
||||
bcc: list[str] = []
|
||||
subject: str = ""
|
||||
html: str = ""
|
||||
text: str = ""
|
||||
attachment_ids: list[uuid.UUID] = []
|
||||
|
||||
|
||||
class DraftIn(BaseModel):
|
||||
account_id: uuid.UUID
|
||||
thread_id: uuid.UUID | None = None
|
||||
reply_to_message_id: uuid.UUID | None = None
|
||||
kind: str = "new" # reply | reply_all | forward | new
|
||||
payload: DraftPayload
|
||||
|
||||
|
||||
class DraftOut(BaseModel):
|
||||
id: uuid.UUID
|
||||
account_id: uuid.UUID
|
||||
thread_id: uuid.UUID | None
|
||||
reply_to_message_id: uuid.UUID | None
|
||||
kind: str
|
||||
payload: dict[str, object]
|
||||
updated_at: str
|
||||
|
||||
|
||||
class SendRequest(BaseModel):
|
||||
draft_id: uuid.UUID
|
||||
|
||||
|
||||
class SendResponse(BaseModel):
|
||||
outbox_id: uuid.UUID
|
||||
undo_until: str
|
||||
|
||||
|
||||
class OutboxStateOut(BaseModel):
|
||||
outbox_id: uuid.UUID
|
||||
state: str
|
||||
Reference in New Issue
Block a user