From 021f0531430a8f6b867c6eecdf1a2ae7dde360a7 Mon Sep 17 00:00:00 2001 From: Saravana Achu Mac Date: Mon, 4 May 2026 15:58:44 -0700 Subject: [PATCH] chore(platform): type predictive campaign events What changed: - Replaced predictive campaign-engine event-bus any casts with typed bus.emit calls. - Preserved existing fire-and-forget event dispatch behavior with void emit calls. Warning impact: - services/platform-service/src/modules/predictive-analytics/campaign-engine.ts: no-explicit-any 5 -> 0. - Workspace lint baseline: 189 warnings -> 184 warnings. Verification: - pnpm --filter @lysnrai/platform-service build - pnpm --filter @lysnrai/platform-service exec eslint src/modules/predictive-analytics/campaign-engine.ts - pnpm --filter @lysnrai/platform-service test - pnpm --filter @lysnrai/platform-service exec eslint . --ext .ts,.tsx - pnpm lint --- .../modules/predictive-analytics/campaign-engine.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/platform-service/src/modules/predictive-analytics/campaign-engine.ts b/services/platform-service/src/modules/predictive-analytics/campaign-engine.ts index 5ee34105..6e5f4ff2 100644 --- a/services/platform-service/src/modules/predictive-analytics/campaign-engine.ts +++ b/services/platform-service/src/modules/predictive-analytics/campaign-engine.ts @@ -128,7 +128,7 @@ export class CampaignEngine { // Emit event for tracking if (!testMode) { - (bus as any).emit('predictive.campaign.triggered', { + void bus.emit('predictive.campaign.triggered', { campaignId: campaign.id, userId: context.userId, productId: context.productId, @@ -334,7 +334,7 @@ export class CampaignEngine { // In production, call delivery module // await deliveryService.sendEmail({...}) - (bus as any).emit('delivery.email.requested', { + void bus.emit('delivery.email.requested', { userId: context.userId, productId: context.productId, templateId, @@ -379,7 +379,7 @@ export class CampaignEngine { }; } - (bus as any).emit('notifications.push.requested', { + void bus.emit('notifications.push.requested', { userId: context.userId, productId: context.productId, title: 'We miss you!', @@ -413,7 +413,7 @@ export class CampaignEngine { }; } - (bus as any).emit('notifications.inapp.create', { + void bus.emit('notifications.inapp.create', { userId: context.userId, productId: context.productId, title: 'Personalized for you', @@ -474,7 +474,7 @@ export class CampaignEngine { ], }; - (bus as any).emit('integrations.slack.notify', { + void bus.emit('integrations.slack.notify', { channel: '#customer-success', message, });