"""Konfigurierbare Kategorie-Optionen (Status, Typen, Rollen etc.)."""

from sqlalchemy import Boolean, Column, Integer, String, UniqueConstraint

from database import Base


class KategorieOption(Base):
    __tablename__ = "kategorie_option"

    id = Column(Integer, primary_key=True, autoincrement=True)
    gruppe = Column(String(50), nullable=False, index=True)
    wert = Column(String(100), nullable=False)
    label = Column(String(200), nullable=False)
    icon = Column(String(10), nullable=True)
    farbe = Column(String(20), nullable=True)
    position = Column(Integer, default=0)
    aktiv = Column(Boolean, default=True)

    __table_args__ = (
        UniqueConstraint("gruppe", "wert", name="uq_gruppe_wert"),
    )
