diff --git a/src/modules/broadcasting/mappers/MessageStatsMapper.ts b/src/modules/broadcasting/mappers/MessageStatsMapper.ts index b0596410..fb9c4e23 100644 --- a/src/modules/broadcasting/mappers/MessageStatsMapper.ts +++ b/src/modules/broadcasting/mappers/MessageStatsMapper.ts @@ -12,7 +12,7 @@ export class MessageStatsMapper { recipientsCount: raw.DELIVER, clickCount: raw.CLICK, openRate: Number(((raw.OPEN * 100) / raw.DELIVER).toFixed(2)), - clickRate: Number(((raw.CLICK * 100) / raw.DELIVER).toFixed(2)), + clickRate: Number(((raw.CLICK * 100) / raw.OPEN).toFixed(2)), } } } diff --git a/src/modules/broadcasting/useCases/GetMessageStats/GetMessageStats.spec.ts b/src/modules/broadcasting/useCases/GetMessageStats/GetMessageStats.spec.ts index 10be8256..7d97809c 100644 --- a/src/modules/broadcasting/useCases/GetMessageStats/GetMessageStats.spec.ts +++ b/src/modules/broadcasting/useCases/GetMessageStats/GetMessageStats.spec.ts @@ -84,7 +84,7 @@ describe('Get Message Stats', () => { }) expect(response.clickCount).toBe(1) - expect(response.clickRate).toBe(33.33) + expect(response.clickRate).toBe(50) expect(response.openRate).toBe(66.67) expect(response.recipientsCount).toBe(3) }) diff --git a/src/modules/broadcasting/useCases/GetMessageStats/GetMessageStatsController.spec.ts b/src/modules/broadcasting/useCases/GetMessageStats/GetMessageStatsController.spec.ts index 023504cc..fa48ac08 100644 --- a/src/modules/broadcasting/useCases/GetMessageStats/GetMessageStatsController.spec.ts +++ b/src/modules/broadcasting/useCases/GetMessageStats/GetMessageStatsController.spec.ts @@ -136,7 +136,7 @@ describe('Get Message Stats (e2e)', () => { recipientsCount: 3, openRate: 66.67, clickCount: 1, - clickRate: 33.33, + clickRate: 50, }) }) })