fix(missing-skus): reconcile stale false positives against Oracle
SKUs mapped externally (via SSH script or direct SQL) never triggered resolve_missing_sku(), leaving them stuck as unresolved=0 indefinitely. New reconcile_unresolved_missing_skus() revalidates ALL unresolved SKUs against Oracle at sync, rescan, and CSV import time. Fail-soft on Oracle down. Clears the 7 prod false positives on next sync or manual rescan. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ from typing import Optional
|
||||
import io
|
||||
import asyncio
|
||||
|
||||
from ..services import mapping_service, sqlite_service
|
||||
from ..services import mapping_service, sqlite_service, validation_service
|
||||
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -168,6 +168,7 @@ async def import_csv(file: UploadFile = File(...)):
|
||||
content = await file.read()
|
||||
text = content.decode("utf-8-sig")
|
||||
result = mapping_service.import_csv(text)
|
||||
await validation_service.reconcile_unresolved_missing_skus()
|
||||
return result
|
||||
|
||||
@router.get("/api/mappings/export-csv")
|
||||
|
||||
Reference in New Issue
Block a user