from enum import Enum as PyEnum

from sqlalchemy import Boolean, Column, DateTime, Enum, ForeignKey, String, Text

from app.models.base import BaseModel


class ReminderStatus(str, PyEnum):
    PENDING = "pending"
    DONE = "done"


class Reminder(BaseModel):
    __tablename__ = "reminders"

    user_id = Column(String(36), ForeignKey("users.id"), nullable=False, index=True)
    title = Column(String(255), nullable=False)
    note = Column(Text, nullable=True)
    reminder_at = Column(DateTime, nullable=False, index=True)
    status = Column(Enum(ReminderStatus), default=ReminderStatus.PENDING, nullable=False)
    is_dismissed = Column(Boolean, default=False, nullable=False)
