- Implemented service classes for PedimentoConfigParameters, PedimentoConfigSurcharges, PedimentoConfigUpdateRectification, PedimentoConfigUpdates, PedimentoCustomsOffices, PedimentoDates, PedimentoDecrementables, PedimentoIncrementables, PedimentoIndexes, PedimentoPayments, PedimentoRectificationDestination, PedimentoRectificationOrigin, PedimentoTransportMeans, and PedimentoValidation. - Each service class includes methods for CRUD operations: create, read, update, and delete. - Added a main router for the API v1, integrating various modules including authentication, tenants, licenses, and pedimentos. - Created models for PedimentoValidation with appropriate constraints and relationships.
34 lines
1.6 KiB
Python
34 lines
1.6 KiB
Python
from sqlalchemy import DateTime, ForeignKeyConstraint, Index, Integer, PrimaryKeyConstraint, Time, UniqueConstraint, text
|
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
from sqlalchemy.orm.base import Mapped
|
|
from core.database import Base
|
|
|
|
class PedimentoDates(Base):
|
|
__tablename__ = 'pedimento_dates'
|
|
__table_args__ = (
|
|
ForeignKeyConstraint(['tenant_id'], ['a76.tenants.id']),
|
|
ForeignKeyConstraint(['pedimento_id'], ['a76.pedimentos.id'], ondelete='CASCADE', name='fk_pedimento_dates'),
|
|
PrimaryKeyConstraint('id', name='pedimento_dates_pkey'),
|
|
UniqueConstraint('pedimento_id', name='pedimento_dates_pedimento_id_key'),
|
|
Index('idx_pedimento_dates_pedimento_id', 'pedimento_id'),
|
|
{'schema': 'a76'}
|
|
)
|
|
|
|
id = mapped_column(Integer)
|
|
pedimento_id = mapped_column(Integer, nullable=False)
|
|
tenant_id = mapped_column(Integer, nullable=False, index=True)
|
|
entry_date = mapped_column(DateTime)
|
|
pedimento_date = mapped_column(DateTime)
|
|
payment_date = mapped_column(DateTime)
|
|
rectification_payment_date = mapped_column(DateTime)
|
|
extraction_date = mapped_column(DateTime)
|
|
submission_date = mapped_column(DateTime)
|
|
eucan_date = mapped_column(DateTime)
|
|
original_date = mapped_column(DateTime)
|
|
start_date = mapped_column(DateTime)
|
|
end_date = mapped_column(DateTime)
|
|
capture_date = mapped_column(DateTime)
|
|
capture_time = mapped_column(Time)
|
|
created_at = mapped_column(DateTime, server_default=text('CURRENT_TIMESTAMP'))
|
|
|
|
pedimento: Mapped['Pedimentos'] = relationship('Pedimentos', back_populates='pedimento_dates') |