feature/clarion-validations-parts-csv

This commit is contained in:
hreyes
2026-03-04 14:57:26 -07:00
parent f6f23dacd2
commit afc0a35f1c
13 changed files with 1087 additions and 99 deletions

View File

@@ -11,7 +11,10 @@ from api.v1.modules.a76.layouts_csv.facturas.template_config import (
TEMPLATE_COLUMNS as IMPORTS_TEMPLATE_COLUMNS,
_resolve_template_columns as resolve_imports_template,
)
from api.v1.modules.a76.layouts_csv.parts.template_config import TEMPLATE_COLUMNS as PARTS_TEMPLATE_COLUMNS
from api.v1.modules.a76.layouts_csv.parts.template_config import (
TEMPLATE_COLUMNS as PARTS_TEMPLATE_COLUMNS,
TEMPLATE_DOWNLOAD_HEADERS as PARTS_TEMPLATE_DOWNLOAD_HEADERS,
)
from api.v1.modules.a76.layouts_csv.boms.template_config import TEMPLATE_COLUMNS as BOMS_TEMPLATE_COLUMNS
from api.v1.modules.a76.layouts_csv.classes.template_config import (
TEMPLATE_COLUMNS as CLASSES_TEMPLATE_COLUMNS,
@@ -59,9 +62,16 @@ def _build_registry() -> Dict[str, List[str]]:
registry[tid] = _canonicals_from_columns(cols)
# part_numbers (parts); "items" usa la misma plantilla
part_cols = PARTS_TEMPLATE_COLUMNS.get("part_numbers")
registry["part_numbers"] = _canonicals_from_columns(part_cols)
registry["items"] = _canonicals_from_columns(part_cols)
registry["part_numbers"] = (
PARTS_TEMPLATE_DOWNLOAD_HEADERS
if PARTS_TEMPLATE_DOWNLOAD_HEADERS
else _canonicals_from_columns(PARTS_TEMPLATE_COLUMNS.get("part_numbers"))
)
registry["items"] = (
PARTS_TEMPLATE_DOWNLOAD_HEADERS
if PARTS_TEMPLATE_DOWNLOAD_HEADERS
else _canonicals_from_columns(PARTS_TEMPLATE_COLUMNS.get("part_numbers"))
)
# boms
registry["boms"] = _canonicals_from_columns(BOMS_TEMPLATE_COLUMNS.get("boms"))