from sqlalchemy import Column, String, Date, Time, Boolean, ForeignKey
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.sql import func
from datetime import datetime
import uuid

from app.core.database import Base

class Task(Base):
    __tablename__ = "tasks"
    
    id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
    user_id = Column(UUID(as_uuid=True), ForeignKey("users.id", ondelete="CASCADE"), nullable=False)
    category_id = Column(UUID(as_uuid=True), nullable=True)  # Removido FK para categories por enquanto
    title = Column(String(255), nullable=False)
    description = Column(String)
    priority = Column(String(20), default='medium')
    status = Column(String(20), default='pending')
    due_date = Column(Date)
    due_time = Column(Time)
    is_archived = Column(Boolean, default=False)
