from beanie import Document from pydantic import Field from datetime import datetime from typing import Optional, Literal class Task(Document): patient_id: str = Field(..., description="ID of the patient this task relates to") description: str = Field(..., description="Task description (e.g. 'Buy milk')") source_message: Optional[str] = Field(None, description="Original chat message that triggered this task") urgency: Literal["low", "medium", "high"] = "medium" status: Literal["pending", "done"] = "pending" category: Literal["health", "logistics", "social", "other"] = "other" created_at: datetime = Field(default_factory=datetime.now) class Settings: name = "tasks"