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


class CustomsSection(Base):
    __tablename__ = "customs_sections"  # GAduanaSec
    __table_args__ = (
        PrimaryKeyConstraint("customs_code", name="customs_code_pkey"),
        {"schema": "public", "extend_existing": True},
    )

    customs_code = mapped_column(String(3), nullable=False)
    section_name = mapped_column(String(255), nullable=False)

    def __repr__(self):
        return f"<CustomsSection(code={self.customs_code}, name={self.section_name })>"
