# backend/modules/todo/schemas.py
from pydantic import BaseModel
from typing import Optional
import datetime


class TodoBase(BaseModel):
    task: str
    date: Optional[datetime.datetime] = None
    remind: bool = False
    complete: bool = False


class TodoCreate(TodoBase):
    pass


class TodoUpdate(BaseModel):
    task: Optional[str] = None
    date: Optional[datetime.datetime] = None
    remind: Optional[bool] = None
    complete: Optional[bool] = None


class Todo(TodoBase):
    id: int
    owner_id: int

    class Config:
        from_attributes = True
