From 3cbe4e843f440f13c803e6be2bd087f770ed4730 Mon Sep 17 00:00:00 2001 From: acazares Date: Fri, 23 Jan 2026 12:20:43 -0600 Subject: [PATCH] fix(models, schemas, service): remove weight_unit field and update part_number references --- backend/api/v1/modules/a76/items/line_quantities/models.py | 1 - backend/api/v1/modules/a76/items/line_quantities/schemas.py | 1 - backend/api/v1/modules/a76/items/service.py | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/api/v1/modules/a76/items/line_quantities/models.py b/backend/api/v1/modules/a76/items/line_quantities/models.py index c7a60558..21baa88d 100644 --- a/backend/api/v1/modules/a76/items/line_quantities/models.py +++ b/backend/api/v1/modules/a76/items/line_quantities/models.py @@ -34,7 +34,6 @@ class LineQuantity(Base): serial_count: Mapped[Optional[int]] = mapped_column(Integer) # CANT_SERIES/CANT_SERIESDEF # Weight - weight_unit: Mapped[Optional[str]] = mapped_column(String(3)) # 'KG' o 'LB' net_weight: Mapped[Optional[Decimal]] = mapped_column(Numeric(19, 8)) # PESONETO gross_weight: Mapped[Optional[Decimal]] = mapped_column(Numeric(19, 8)) # PESOBRUTO diff --git a/backend/api/v1/modules/a76/items/line_quantities/schemas.py b/backend/api/v1/modules/a76/items/line_quantities/schemas.py index 71552342..fa1a5ecc 100644 --- a/backend/api/v1/modules/a76/items/line_quantities/schemas.py +++ b/backend/api/v1/modules/a76/items/line_quantities/schemas.py @@ -22,7 +22,6 @@ class LineQuantityBase(BaseModel): serial_count: Optional[int] = Field(None, description="Serial count (CANT_SERIES/CANT_SERIESDEF)") # Weight - weight_unit: Optional[str] = Field(None, max_length=3, description="Weight unit ('KG' or 'LB')") net_weight: Optional[Decimal] = Field(None, description="Net weight (PESONETO)") gross_weight: Optional[Decimal] = Field(None, description="Gross weight (PESOBRUTO)") diff --git a/backend/api/v1/modules/a76/items/service.py b/backend/api/v1/modules/a76/items/service.py index 912a7b89..2efe582a 100644 --- a/backend/api/v1/modules/a76/items/service.py +++ b/backend/api/v1/modules/a76/items/service.py @@ -194,7 +194,7 @@ class ItemService: # Validaciones adicionales específicas del negocio # Validar apóstrofes en número de parte - if line_data.part_number and "'" in str(line_data.part_number): + if line_data.part_number_id and "'" in str(line_data.part_number_id): errors.add_error( field=f"lines[{idx}].part_number", message=f"Advertencia: El Número de Parte contiene apóstrofes y serán omitidos", @@ -420,7 +420,7 @@ class ItemService: # (Aplican tanto para crear como actualizar) # Validar apóstrofes en número de parte - if line_data.part_number and "'" in str(line_data.part_number): + if line_data.part_number_id and "'" in str(line_data.part_number_id): errors.add_error( field=f"lines[{idx}].part_number", message=f"Advertencia: El Número de Parte contiene apóstrofes y serán omitidos",