ifta: 3-touch business-day cadence + 'I already filed it' suppression
- Multi-touch reminders at 10/7/4 BUSINESS days before each deadline (weekends skipped; biz-day math so a touch never lands purely on a weekend with no runway). Escalating tone soft -> urgent -> last-chance, with the 'almost too late to DIY, we can still file it' angle so it's a convenience sale, not a free reminder service. ifta_touch_no tracks the highest touch sent so each touch hits only carriers below that level; never repeats a touch. - 'I already filed it' one-click link: HMAC-tokenized GET /api/v1/ifta/filed (token matches between Python builder and api/src/routes/ifta.ts -- verified identical output), records ifta_self_filed_at, friendly confirmation page, stops further touches this cycle + gives DIY-vs-prospect signal. Builder excludes self-filed carriers. - migration 094 (ifta_touch_no) + 095 (ifta_self_filed_at); cycle reset clears both each new quarter. Verified: biz-day touch schedule, token cross-match.
This commit is contained in:
parent
872154ebf7
commit
3d4226e95c
6 changed files with 220 additions and 40 deletions
|
|
@ -1,11 +1,13 @@
|
|||
-- Track which interstate carriers have been sent the IFTA quarterly-return
|
||||
-- reminder this cycle, so the daily IFTA cron never double-sends within a quarter.
|
||||
-- The IFTA campaign builder resets this column at the start of each new quarter's
|
||||
-- reminder window (see build_ifta_quarterly_campaign.py).
|
||||
-- Track IFTA quarterly-return reminder touches per interstate carrier so the
|
||||
-- multi-touch cadence (10/7/4 business days before deadline) never repeats a
|
||||
-- touch and escalates correctly. Reset each new quarter by the IFTA builder.
|
||||
-- ifta_reminded_at : timestamp of the most recent IFTA touch (any)
|
||||
-- ifta_touch_no : highest touch number sent this cycle (1=10d, 2=7d, 3=4d)
|
||||
|
||||
ALTER TABLE fmcsa_carriers
|
||||
ADD COLUMN IF NOT EXISTS ifta_reminded_at TIMESTAMPTZ;
|
||||
ADD COLUMN IF NOT EXISTS ifta_reminded_at TIMESTAMPTZ,
|
||||
ADD COLUMN IF NOT EXISTS ifta_touch_no SMALLINT;
|
||||
|
||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_fmcsa_carriers_ifta_reminded
|
||||
ON fmcsa_carriers (ifta_reminded_at)
|
||||
WHERE ifta_reminded_at IS NULL;
|
||||
ON fmcsa_carriers (ifta_touch_no)
|
||||
WHERE carrier_operation = 'A';
|
||||
|
|
|
|||
12
api/migrations/095_fmcsa_ifta_self_filed.sql
Normal file
12
api/migrations/095_fmcsa_ifta_self_filed.sql
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
-- "I already filed it" suppression for IFTA quarterly reminders.
|
||||
-- When a carrier clicks the one-click "I already filed it" link in a reminder
|
||||
-- email, we record it here: it stops further touches THIS cycle (the IFTA
|
||||
-- builder excludes self-filed carriers) and gives us DIY-vs-prospect signal.
|
||||
-- Reset each new quarter alongside ifta_reminded_at.
|
||||
|
||||
ALTER TABLE fmcsa_carriers
|
||||
ADD COLUMN IF NOT EXISTS ifta_self_filed_at TIMESTAMPTZ;
|
||||
|
||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_fmcsa_carriers_ifta_self_filed
|
||||
ON fmcsa_carriers (ifta_self_filed_at)
|
||||
WHERE ifta_self_filed_at IS NULL;
|
||||
Loading…
Add table
Add a link
Reference in a new issue