feat(15-03): register phishing-sweep schedule + migration 098

- extend sync_type union with 'phishing-sweep'
- add defaultSchedules entry (disabled by default, daily 5am cron)
- dispatch branch dynamically imports and calls sweepPhishingTickets
- migrations/098_phishing_sweep_schedule.sql seeds the row for existing installs
This commit is contained in:
lorentz 2026-07-15 07:49:01 -04:00
parent 194b58b196
commit b199d9991c
2 changed files with 40 additions and 1 deletions

View file

@ -0,0 +1,25 @@
-- Migration 098: Seed the phishing-sweep sync schedule.
--
-- The sync_scheduler.createDefaultSchedules() path only seeds defaults on a
-- virgin sync_schedules table; this migration covers existing installs.
-- Idempotent via ON CONFLICT (id) DO NOTHING. Disabled by default
-- (is_enabled=false) until an admin opts in via /admin.
INSERT INTO sync_schedules (
id,
name,
description,
cron_expression,
sync_type,
years_back,
is_enabled
) VALUES (
'phishing-sweep',
'Phishing Detection Sweep',
'Reconciles recently-modified tickets through the phishing detector to catch reports missed by the webhook path (bounded to 500 tickets, idempotent on content hash).',
'0 5 * * *',
'phishing-sweep',
NULL,
false
)
ON CONFLICT (id) DO NOTHING;