Skip to main content

sync:all

Overview​

Runs the complete daily sync pipeline: Stripe transaction sync, QuickBooks Online sync, automated transaction matching, anomaly detection, and alert email notifications. This is the primary production command, typically scheduled via cron at 6 AM daily.

Usage​

npm run sync:all

Pipeline Steps​

  1. Stripe transactions sync (7-day lookback)
  2. QuickBooks Online transactions sync (7-day lookback)
  3. Automated transaction matching
  4. Anomaly detection
  5. Alert email notifications

Prerequisites​

  • Repo: symphonycore-org/sc-finance-sync
  • Install: npm install from repo root
  • Environment: All sync credentials (STRIPE_API_KEY, QBO_CLIENT_ID, QBO_CLIENT_SECRET, QBO_REALM_ID, FIREFLY_API_TOKEN, DATABASE_URL)
  • Optional: SMTP credentials for alert emails (SMTP_HOST, SMTP_USER, SMTP_PASS, ALERT_EMAIL_TO)

Examples​

Manual full sync​

npm run sync:all

Production (via Docker)​

docker exec sc-finance-sync npm run sync:all

Scheduling​

The container automatically runs sync:all via node-cron. Schedule is configurable via SYNC_CRON_SCHEDULE (default: 0 6 * * * = 6 AM daily).

Output​

Prints "Full Sync Completed" on success. Exit code 0 on success, 1 on failure.