from pydantic import BaseModel
from typing import Optional
from datetime import date, time
import uuid

class TaskCreate(BaseModel):
    title: str
    description: Optional[str] = None
    priority: str = "medium"  # low, medium, high
    status: str = "pending"  # pending, in_progress, completed
    due_date: Optional[date] = None
    due_time: Optional[time] = None
    category_id: Optional[uuid.UUID] = None

class TaskResponse(BaseModel):
    id: uuid.UUID
    user_id: uuid.UUID
    title: str
    description: Optional[str]
    priority: str
    status: str
    due_date: Optional[date]
    due_time: Optional[time]
    is_archived: bool
    category_id: Optional[uuid.UUID]
    
    class Config:
        from_attributes = True

class TaskUpdate(BaseModel):
    title: Optional[str] = None
    description: Optional[str] = None
    priority: Optional[str] = None
    status: Optional[str] = None
    due_date: Optional[date] = None
    due_time: Optional[time] = None
    is_archived: Optional[bool] = None
    category_id: Optional[uuid.UUID] = None

