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
- Stripe transactions sync (7-day lookback)
- QuickBooks Online transactions sync (7-day lookback)
- Automated transaction matching
- Anomaly detection
- Alert email notifications
Prerequisites
- Repo: symphonycore-org/sc-finance-sync
- Install:
npm installfrom 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.