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


class Incoterm(Base):
    __tablename__ = "incoterms"  # GIncoterm
    __table_args__ = (
        PrimaryKeyConstraint("code", name="incoterms_pkey"),
        {"schema": "public", "extend_existing": True},
    )

    code: Mapped[str] = mapped_column(String(5), nullable=False)
    description_es: Mapped[str] = mapped_column(String(256), nullable=False)
    description_en: Mapped[str] = mapped_column(String(256), nullable=False)

    def __repr__(self):
        return f"<Incoterm(code={self.code}, description_es={self.description_es}, description_en={self.description_en})>"
