fix: update segment filter logic to retain value and unit, enhance activity name mapping

This commit is contained in:
Dries Augustyns
2026-05-04 19:35:29 +02:00
parent a3cc62213f
commit a126563542
2 changed files with 8 additions and 3 deletions
+6 -1
View File
@@ -1301,13 +1301,18 @@ export class SegmentService {
value: unknown,
unit?: 'days' | 'hours' | 'minutes',
): Prisma.ContactWhereInput {
// Map activity names to Email model fields
// Map activity names to Email model fields (accept both verb and past-tense forms)
const fieldMap: Record<string, string> = {
open: 'openedAt',
opened: 'openedAt',
click: 'clickedAt',
clicked: 'clickedAt',
bounce: 'bouncedAt',
bounced: 'bouncedAt',
complaint: 'complainedAt',
complained: 'complainedAt',
sent: 'sentAt',
delivery: 'deliveredAt',
delivered: 'deliveredAt',
};