import uuid
from datetime import datetime
from sqlalchemy import Column, String, Boolean, DateTime, Enum
from enum import Enum as PyEnum
from app.models.base import BaseModel


class TodoSource(str, PyEnum):
    AI_KANBAN = "ai_kanban"
    AI_CHAT = "ai_chat"
    MANUAL = "manual"


class DailyTodo(BaseModel):
    __tablename__ = "daily_todos"

    user_id = Column(String(36), nullable=False, index=True)
    title = Column(String(500), nullable=False)
    is_completed = Column(Boolean, default=False, nullable=False)
    source = Column(Enum(TodoSource), default=TodoSource.MANUAL, nullable=False)
    source_detail = Column(String(500), nullable=True)
    source_ref_id = Column(String(36), nullable=True)
    todo_date = Column(String(10), nullable=False)  # YYYY-MM-DD
    completed_at = Column(DateTime, nullable=True)
