diff --git a/src/lib/services/alert-rules.ts b/src/lib/services/alert-rules.ts index a054d9ba..2b093754 100644 --- a/src/lib/services/alert-rules.ts +++ b/src/lib/services/alert-rules.ts @@ -74,9 +74,18 @@ async function reservationNoAgreement(portId: string): Promise // Pipeline stuck in mid-funnel stages with no contact for 14+ days. async function interestStale(portId: string): Promise { - // Mid-funnel stages where silence is a problem. EOI/deposit/contract stages - // have their own dedicated alerts (eoi.unsigned_long, deposit_overdue, etc.). - const STALE_STAGES = ['details_sent', 'in_communication', 'eoi_sent']; + // Mid-funnel stages where silence is a problem. EOI / reservation / + // deposit / contract stages have their own dedicated alerts + // (eoi.unsigned_long, reservation.no_agreement, deposit_overdue, etc.), + // so this alert sits before signing kicks in. + // + // 2026-05-14 pipeline-refactor sweep: the prior values + // ('details_sent', 'in_communication', 'eoi_sent') were collapsed by + // migration 0062 into the 7-stage canon (enquiry / qualified / + // nurturing / eoi / ...). Until this fix landed, this alert never + // fired because no row in the new schema carried the dead stage + // strings. + const STALE_STAGES = ['enquiry', 'qualified', 'nurturing']; const rows = await db .select({ id: interests.id, diff --git a/src/lib/services/berth-recommender.service.ts b/src/lib/services/berth-recommender.service.ts index b894b03b..90f6148d 100644 --- a/src/lib/services/berth-recommender.service.ts +++ b/src/lib/services/berth-recommender.service.ts @@ -482,14 +482,13 @@ export async function recommendBerths(args: RecommendBerthsArgs): Promise