| from pydantic import BaseModel | |
| from typing import Optional | |
| from datetime import datetime | |
| class GoalBase(BaseModel): | |
| title: str | |
| description: Optional[str] = "" | |
| target_date: Optional[datetime] = None | |
| class GoalCreate(GoalBase): | |
| pass | |
| class GoalUpdate(GoalBase): | |
| title: Optional[str] = None | |
| class GoalInDB(GoalBase): | |
| id: str | |
| user_id: str | |
| created_at: datetime | |
| updated_at: datetime | |
| class GoalList(BaseModel): | |
| goals: list[GoalInDB] | |