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
This commit is contained in:
Saravana Achu Mac 2026-05-04 15:58:44 -07:00
parent 437a0fed5a
commit 021f053143

View File

@ -128,7 +128,7 @@ export class CampaignEngine {
// Emit event for tracking // Emit event for tracking
if (!testMode) { if (!testMode) {
(bus as any).emit('predictive.campaign.triggered', { void bus.emit('predictive.campaign.triggered', {
campaignId: campaign.id, campaignId: campaign.id,
userId: context.userId, userId: context.userId,
productId: context.productId, productId: context.productId,
@ -334,7 +334,7 @@ export class CampaignEngine {
// In production, call delivery module // In production, call delivery module
// await deliveryService.sendEmail({...}) // await deliveryService.sendEmail({...})
(bus as any).emit('delivery.email.requested', { void bus.emit('delivery.email.requested', {
userId: context.userId, userId: context.userId,
productId: context.productId, productId: context.productId,
templateId, templateId,
@ -379,7 +379,7 @@ export class CampaignEngine {
}; };
} }
(bus as any).emit('notifications.push.requested', { void bus.emit('notifications.push.requested', {
userId: context.userId, userId: context.userId,
productId: context.productId, productId: context.productId,
title: 'We miss you!', 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, userId: context.userId,
productId: context.productId, productId: context.productId,
title: 'Personalized for you', 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', channel: '#customer-success',
message, message,
}); });