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


class TransportType(Base):
    __tablename__ = "transport_types"  # GTiposTransporte
    __table_args__ = (
        PrimaryKeyConstraint("transport_code", name="transport_types_pkey"),
        {"schema": "public", "extend_existing": True},
    )

    transport_code: Mapped[str] = mapped_column(
        String(2), nullable=False
    )  # código SAT o interno
    description: Mapped[str] = mapped_column(
        String(100), nullable=False
    )  # descripción del medio de transporte

    def __repr__(self):
        return f"<TransportType(code={self.transport_code}, description={self.description})>"
