"""
Settings Model for storing system configurations
"""
from sqlalchemy import Column, Integer, String, Text
from app.models.base import Base, TimestampMixin

class Setting(Base, TimestampMixin):
    """
    Key-Value storage for system settings
    """
    __tablename__ = "settings"

    id = Column(Integer, primary_key=True, index=True)
    key = Column(String, unique=True, index=True, nullable=False)
    value = Column(Text, nullable=True) # JSON or simple string
    description = Column(String, nullable=True)

    def __repr__(self):
        return f"<Setting(key='{self.key}', value='{self.value}')>"
