Photo Pipeline
Trigger: crew uploads photo to a job's Slack channel
1
Slack Bot receives the image via Slack Events API (real-time, always on)
2
Bot copies the photo to NAS at /Volumes/Construction Server/{job}/Photos from Slack/
3
Bot uploads the photo to QBO as an attachment on the matching customer record
4
Photo now lives in 3 places: Slack (original), NAS (backup), QBO (accounting)
Cash Invoice Handling
Trigger: daily at 6:00 AM (cron)
1
Queries QBO API for invoices to cash-pay customers (^ marker in QBO display name, loaded live)
2
Exports each invoice to Excel + PDF (local archive)
3
Voids the invoice in QBO — cash customers get paper invoices only
4
Pool Brain invoice deletion is done manually by Christian (automation runs --skip-pb)
Contract → Layout → Build
Trigger: salesperson creates a contract
1
Contract Generator (web app) captures pool specs, options, pricing
2
Contract data syncs to Pool Layout Tool which auto-generates the engineering drawing
3
Layout uses Fabric.js + Maker.js — rectangle pool, cross-section, coping, features
4
Both feed back to Dashboard API which tracks the job through construction
Health Monitoring V2
Trigger: every 15 minutes (cron) — 39 checks
1
Calls QBO API with live token to verify it works (not just file age). Checks token expiry math.
2
Logs into all 4 email accounts (3 Gmail + Outlook) via IMAP to verify credentials + mailbox access
3
Checks every LaunchAgent loaded, always-on processes running, logs for errors + staleness
4
Pings every web app, NAS read test, Dashboard API. Posts failures to Slack #management