feature/csv-pruebas
This commit is contained in:
@@ -44,15 +44,15 @@ def scan_file(self, job_id: str, model_target: str, config: str = None):
|
||||
|
||||
if model_target == "invoice_header":
|
||||
from api.v1.modules.a76.layouts_csv.facturas.tasks import _do_scan_file
|
||||
return _do_scan_file(job_id, "invoice_header", config, job_type_override="exp")
|
||||
return _do_scan_file(self, job_id, "invoice_header", config, job_type_override="exp")
|
||||
|
||||
if model_target == "invoice_details":
|
||||
from api.v1.modules.a76.layouts_csv.facturas.tasks import _do_scan_file
|
||||
return _do_scan_file(job_id, "invoice_details", config, job_type_override="exp")
|
||||
return _do_scan_file(self, job_id, "invoice_details", config, job_type_override="exp")
|
||||
|
||||
if model_target == "invoice_series":
|
||||
from api.v1.modules.a76.layouts_csv.facturas.tasks import _do_scan_file
|
||||
return _do_scan_file(job_id, "invoice_series", config, job_type_override="exp")
|
||||
return _do_scan_file(self, job_id, "invoice_series", config, job_type_override="exp")
|
||||
|
||||
# Fallback (e.g. unknown model_target)
|
||||
file_path = _ensure_file(job_id)
|
||||
|
||||
@@ -185,10 +185,10 @@ def _validate_customs_broker_ref(
|
||||
@celery_app.task(bind=True)
|
||||
def scan_file(self, job_id: str, model_target: str, config: str = None, job_type_override: Optional[str] = None):
|
||||
"""Pass 1: Read CSV, Validate types, Write Errors to JSONL. Delegates to _do_scan_file."""
|
||||
return _do_scan_file(job_id, model_target, config, job_type_override)
|
||||
return _do_scan_file(self, job_id, model_target, config, job_type_override)
|
||||
|
||||
|
||||
def _do_scan_file(job_id: str, model_target: str, config: Optional[str] = None, job_type_override: Optional[str] = None) -> Dict[str, Any]:
|
||||
def _do_scan_file(self, job_id: str, model_target: str, config: Optional[str] = None, job_type_override: Optional[str] = None) -> Dict[str, Any]:
|
||||
"""Pass 1 body: load file/meta from storage, run validations, store error lines. Uses effective_job_type for storage."""
|
||||
effective_job_type = job_type_override if job_type_override is not None else JOB_TYPE
|
||||
log_prefix = "Exportación import" if effective_job_type else "Invoices import"
|
||||
|
||||
Reference in New Issue
Block a user