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


class PaymentMethod(Base):
    __tablename__ = "payment_methods"  # GFormaPago
    __table_args__ = (
        PrimaryKeyConstraint("key", name="payment_methods_pkey"),
        {"schema": "public", "extend_existing": True},  # opcional
    )

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

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