feat(sync): already_imported tracking, invoice cache, path fixes, remove vfp

- Track already_imported/new_imported counts separately in sync_runs
  and surface them in status API + dashboard last-run card
- Cache invoice data in SQLite orders table (factura_* columns);
  dashboard falls back to Oracle only for uncached imported orders
- Resolve JSON_OUTPUT_DIR and SQLITE_DB_PATH relative to known
  anchored roots in config.py, independent of CWD (fixes WSL2 start)
- Use single Oracle connection for entire validation phase (perf)
- Batch upsert web_products instead of one-by-one
- Remove stale VFP scripts (replaced by gomag-vending.prg workflow)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-14 00:15:37 +02:00
parent 8681a92eec
commit 2e65855fe2
24 changed files with 485 additions and 3458 deletions

View File

@@ -35,14 +35,16 @@ APP_PORT=5003
LOG_LEVEL=INFO
# =============================================================================
# CALE FISIERE (relative la project root - directorul gomag/)
# CALE FISIERE
# Relative: JSON_OUTPUT_DIR la project root, SQLITE_DB_PATH la api/
# Se pot folosi si cai absolute
# =============================================================================
# JSON-uri descarcate de VFP
JSON_OUTPUT_DIR=vfp/output
# JSON-uri comenzi GoMag
JSON_OUTPUT_DIR=output
# SQLite tracking DB
SQLITE_DB_PATH=api/data/import.db
SQLITE_DB_PATH=data/import.db
# =============================================================================
# ROA - Setari import comenzi (din vfp/settings.ini sectiunea [ROA])