from core.database import Base
from sqlalchemy import PrimaryKeyConstraint, String
from sqlalchemy.orm import Mapped, mapped_column


class LicenseException(Base):
    __tablename__ = "license_exceptions"
    __table_args__ = (
        PrimaryKeyConstraint("key", name="license_exceptions_pkey"),
        {"schema": "public", "extend_existing": True},
    )

    key: Mapped[str] = mapped_column(
        String(10), primary_key=True, nullable=False)  # clave del simbolo
    description: Mapped[str] = mapped_column(
        String(500), nullable=False
    )  # descripción oficial (en español)

    def __repr__(self):
        return f"<LicenseException(key={self.key}, description={self.description})>"
