se arreglo los furmularios de partes

This commit is contained in:
2026-03-19 12:49:16 -05:00
parent e570fd5b2e
commit 37920aa303
4 changed files with 6 additions and 6 deletions

View File

@@ -3455,7 +3455,7 @@ def upgrade() -> None:
sa.Column('origin_country', sa.String(length=3), nullable=True),
sa.Column('fraction_type', sa.String(length=10), nullable=True),
sa.Column('agency_code_definition', sa.String(length=50), nullable=True),
sa.Column('carta_porte_codes', sa.String(length=100), nullable=True),
sa.Column('carta_porte', sa.String(length=100), nullable=True),
sa.Column('client_part_names', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
sa.Column('part_identifiers', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
sa.Column('substitute_parts', postgresql.JSONB(astext_type=sa.Text()), nullable=True),

View File

@@ -138,6 +138,7 @@ class InvPart(Base, TenantScopedMixin, TimestampMixin):
# --- NUEVOS CAMPOS EXTENSION ---
agency_code_definition: Mapped[Optional[str]] = mapped_column(String(50)) # Fila 7
carta_porte: Mapped[Optional[str]] = mapped_column(String(100)) # Fila 10
client_part_names: Mapped[Optional[list]] = mapped_column(JSONB, nullable=True, default=[]) # Fila 5
part_identifiers: Mapped[Optional[list]] = mapped_column(JSONB, nullable=True, default=[]) # Fila 9
substitute_parts: Mapped[Optional[list]] = mapped_column(JSONB, nullable=True, default=[]) # Pestaña Continuación

View File

@@ -6,9 +6,9 @@ from api.v1.modules.a24.inv.inv_aphis.dto import InvPartAphisGeneralDTO
# --- SUB-DTO: DATOS ADUANALES (FaData) ---
class FaDataDTO(BaseModel):
origin_country: Optional[str] = Field(default=None, pattern=r"^[A-Z]{3}$")
sector: Optional[str] = Field(default=None, pattern=r"^[A-Za-z0-9]{1,8}$")
fraction_type: Optional[Literal["GENERAL", "PROSEC", "ALADI", "TLCS"]] = None
origin_country: Optional[str] = None
sector: Optional[str] = None
fraction_type: Optional[str] = None
model_config = ConfigDict(from_attributes=True)

View File

@@ -22,8 +22,7 @@ logger = logging.getLogger(__name__)
class PartService:
"""Servicio para gestión de Partes (Anexo 76 + Anexo 24)"""
# Estos campos están en el modelo pero NO en la DB todavía (faltan las migraciones del usuario)
# Los diferimos en SELECT y los filtramos en INSERT/UPDATE para que el sistema no truene.
# Estos campos están en el modelo pero NO en la DB todavía, faltan las migraciones del usuario
MISSING_INV_COLUMNS = []
# Campos que SÍ existen en la DB (Verificados con \d a24.inv_partes)