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.
This commit is contained in:
2025-10-19 19:03:15 -05:00
parent 2a10d7d267
commit 58a2f0ade6
41 changed files with 1324 additions and 187 deletions

View File

@@ -0,0 +1,16 @@
from sqlalchemy import String, PrimaryKeyConstraint
from sqlalchemy.orm import mapped_column, Mapped
from core.database import Base
class ValuationMethod(Base):
__tablename__ = "valuation_methods" #GMetValor
__table_args__ = (
PrimaryKeyConstraint("key", name="valuation_methods_pkey"),
{"schema": "public"}
)
key: Mapped[str] = mapped_column(String(2), nullable=False)
description: Mapped[str] = mapped_column(String(200), nullable=False)
def __repr__(self):
return f"<ValuationMethod(key={self.key}, description={self.description})>"

View File

@@ -0,0 +1,9 @@
seed = [
("0", "VALOR COMERCIAL (CLAVE USADA SOLO A LA EXPORTACION)."),
("1", "VALOR DE TRANSACCION DE LAS MERCANCIAS."),
("2", "VALOR DE TRANSACCION DE MERCANCIAS IDENTICAS."),
("3", "VALOR DE TRANSACCION DE MERCANCIAS SIMILARES."),
("4", "VALOR DE PRECIO UNITARIO DE VENTA."),
("5", "VALOR RECONSTRUIDO."),
("6", "ULTIMO RECURSO"),
]