"""facet_values 테이블 ORM — facet 축별 허용값 사전"""

from datetime import datetime

from sqlalchemy import BigInteger, Boolean, DateTime, Text
from sqlalchemy.orm import Mapped, mapped_column

from core.database import Base


class FacetValue(Base):
    __tablename__ = "facet_values"

    id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
    facet_type: Mapped[str] = mapped_column(Text, nullable=False)  # company, topic, doctype
    value: Mapped[str] = mapped_column(Text, nullable=False)
    is_system: Mapped[bool] = mapped_column(Boolean, default=False)
    created_at: Mapped[datetime] = mapped_column(
        DateTime(timezone=True), default=datetime.now
    )
