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


class TransportMode(Base):
    __tablename__ = "transport_modes"  # GModTransporte
    __table_args__ = (
        PrimaryKeyConstraint("key", name="transport_modes_pkey"),
        {"schema": "public", "extend_existing": True},  # opcional
    )

    key: Mapped[str] = mapped_column(String(3), nullable=False)
    name: Mapped[str] = mapped_column(String(30), nullable=False)

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