from enum import Enum as PyEnum

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

from app.models.base import BaseModel


class GoalStatus(str, PyEnum):
    ACTIVE = "active"
    DONE = "done"
    ARCHIVED = "archived"


class Goal(BaseModel):
    __tablename__ = "goals"

    user_id = Column(String(36), ForeignKey("users.id"), nullable=False, index=True)
    title = Column(String(255), nullable=False)
    note = Column(Text, nullable=True)
    goal_date = Column(String(10), nullable=False, index=True)
    status = Column(Enum(GoalStatus), default=GoalStatus.ACTIVE, nullable=False)
