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:
@@ -0,0 +1,16 @@
|
||||
from sqlalchemy import String, PrimaryKeyConstraint
|
||||
from sqlalchemy.orm import mapped_column, Mapped
|
||||
from core.database import Base
|
||||
|
||||
class PaymentMethod(Base):
|
||||
__tablename__ = "payment_methods" #GFormaPago
|
||||
__table_args__ = (
|
||||
PrimaryKeyConstraint("key", name="payment_methods_pkey"),
|
||||
{"schema": "public"} # opcional
|
||||
)
|
||||
|
||||
key: Mapped[str] = mapped_column(String(2), nullable=False)
|
||||
description: Mapped[str] = mapped_column(String(100), nullable=False)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<PaymentMethod(key={self.key}, description={self.description})>"
|
||||
@@ -0,0 +1,22 @@
|
||||
seed = [
|
||||
("0", "EFECTIVO."),
|
||||
("10", "DEROGADA. --- (CERTIFICADOS ESPECIALES DE TESORERIA PUBLICO)"),
|
||||
("11", "DEROGADA. --- (CERTIFICADOS ESPECIALES DE TESORERIA PRIVADO)"),
|
||||
("12", "COMPENSACION."),
|
||||
("13", "PAGO YA EFECTUADO."),
|
||||
("14", "CONDONACIONES."),
|
||||
("15", "CUENTAS ADUANERAS DE GARANTIA POR PRECIOS ESTIMADOS"),
|
||||
("16", "ACREDITAMIENTO."),
|
||||
("18", "ESTIMULO FISCAL."),
|
||||
("19", "OTROS MEDIOS DE GARANTIA."),
|
||||
("2", "FIANZA."),
|
||||
("20", "DEROGADA. --- (PAGO CONFORME AL ARTICULO 7 DE LA LEY DE INGRESOS DE LA FEDERACION, VIGENTE)"),
|
||||
("21", "CRÉDITO EN IVA E IEPS."),
|
||||
("22", "GARANTÍA EN IVA E IEPS."),
|
||||
("4", "DEPOSITO EN CUENTA ADUANERA."),
|
||||
("5", "TEMPORAL NO SUJETA A IMPUESTOS."),
|
||||
("6", "PENDIENTE DE PAGO."),
|
||||
("7", "CARGO A PARTIDA PRESUPUESTAL GOBIERNO FEDERAL."),
|
||||
("8", "FRANQUICIA."),
|
||||
("9", "EXENTO DE PAGO."),
|
||||
]
|
||||
Reference in New Issue
Block a user