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

@@ -19,10 +19,10 @@ if [ api/requirements.txt -nt venv/.deps_installed ] || [ ! -f venv/.deps_instal
fi
# Stop any existing instance on port 5003
EXISTING_PID=$(lsof -ti tcp:5003 2>/dev/null)
if [ -n "$EXISTING_PID" ]; then
echo "Stopping existing process on port 5003 (PID $EXISTING_PID)..."
kill "$EXISTING_PID"
EXISTING_PIDS=$(lsof -ti tcp:5003 2>/dev/null)
if [ -n "$EXISTING_PIDS" ]; then
echo "Stopping existing process(es) on port 5003 (PID $EXISTING_PIDS)..."
echo "$EXISTING_PIDS" | xargs kill 2>/dev/null
sleep 2
fi