from typing import List, Dict, Any class Generador504SCAF: @staticmethod def preparar_listado_json(id_pedimento: int, contenedores_raw: str) -> List[Dict[str, Any]]: """ Procesa el string de contenedores (CONT1|TIPO1,CONT2|TIPO2) y genera una lista de registros para la API - Versión SCAF. """ registros = [] if not contenedores_raw or contenedores_raw.strip() == "": return registros bloques = contenedores_raw.split(",") for bloque in bloques: if not bloque.strip(): continue partes = bloque.split("|") num_contenedor = partes[0].strip() if len(partes) > 0 else "" tipo_contenedor = partes[1].strip() if len(partes) > 1 else " " if num_contenedor: registros.append({ "id_pedimento_501": id_pedimento, "numero_contenedor_504": num_contenedor, "tipo_contenedor_504": tipo_contenedor, "status_504": "1" }) return registros