Files
plantillas-proyectos/backend/api/v1/modules/public/reference_data/incoterms/models.py
acazares 58a2f0ade6 Add reference data models and seed data for incoterms, invoice types, material types, payment methods, pedimento codes, pedimento regimens, sectors, states, transport modes, transport types, and valuation methods
- Implemented SQLAlchemy models for incoterms, invoice types, material types, payment methods, pedimento codes, pedimento regimens, sectors, states, transport modes, transport types, and valuation methods.
- Added seed data for each reference data model to populate the database with initial values.
- Ensured primary key constraints and appropriate data types for each model.
- Established relationships where necessary, particularly in pedimento codes and regimens.
2025-10-19 19:03:15 -05:00

18 lines
685 B
Python

from sqlalchemy import String, PrimaryKeyConstraint
from sqlalchemy.orm import mapped_column, Mapped
from core.database import Base
class Incoterm(Base):
__tablename__ = "incoterms" #GIncoterm
__table_args__ = (
PrimaryKeyConstraint("code", name="incoterms_pkey"),
{"schema": "public"}
)
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})>"