from typing import Optional
from sqlalchemy import Integer, String, UniqueConstraint
from sqlalchemy.orm import Mapped, mapped_column
from api.v1.common.base_models import TenantScopedMixin, TimestampMixin
from core.database import Base


class ClassificationConcept(Base, TenantScopedMixin, TimestampMixin):
    __tablename__ = "classification_concepts"
    __table_args__ = (
        UniqueConstraint("classification", name="uq_classification_concept"),
        {"schema": "a76", "extend_existing": True},
    )

    id: Mapped[int] = mapped_column(
        Integer, primary_key=True, autoincrement=True)
        
    classification: Mapped[str] = mapped_column(
        String(30), nullable=False)  # CLASIFICACION
        
    description: Mapped[Optional[str]] = mapped_column(
        String(255), nullable=True)  # DESCRIPCION
