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


class ValuationMethod(Base):
    __tablename__ = "valuation_methods"  # GMetValor
    __table_args__ = (
        PrimaryKeyConstraint("key", name="valuation_methods_pkey"),
        {"schema": "public", "extend_existing": True},
    )

    key: Mapped[str] = mapped_column(String(2), nullable=False)
    description: Mapped[str] = mapped_column(String(200), nullable=False)

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