From 56d24ec74c0c21bcdcdf262b4feec6edd1dff51c Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Wed, 31 Jan 2024 01:44:46 +0530 Subject: [PATCH 1/3] fix: purchsse events for reddit --- src/cdk/v2/destinations/reddit/procWorkflow.yaml | 2 +- test/integrations/destinations/reddit/processor/data.ts | 5 ++++- test/integrations/destinations/reddit/router/data.ts | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cdk/v2/destinations/reddit/procWorkflow.yaml b/src/cdk/v2/destinations/reddit/procWorkflow.yaml index 65b466bc7c..652ee2f784 100644 --- a/src/cdk/v2/destinations/reddit/procWorkflow.yaml +++ b/src/cdk/v2/destinations/reddit/procWorkflow.yaml @@ -56,7 +56,7 @@ steps: const event_type = (eventNames.length === 0 || eventNames[0]==="") ? ({"tracking_type": "Custom", "custom_event_name": event}): ({tracking_type: eventNames[0]}); - name: customFields - condition: $.outputs.eventType.tracking_type === "Purchase" + condition: $.outputs.prepareTrackPayload.eventType.tracking_type === "Purchase" template: | const customFields = .message.().({ "currency": .properties.currency, diff --git a/test/integrations/destinations/reddit/processor/data.ts b/test/integrations/destinations/reddit/processor/data.ts index 91da5fbe67..09bbd3e587 100644 --- a/test/integrations/destinations/reddit/processor/data.ts +++ b/test/integrations/destinations/reddit/processor/data.ts @@ -126,7 +126,10 @@ export const data = [ screen_dimensions: {}, }, event_metadata: { - item_count: 3, + item_count: 2, + currency: 'USD', + value: 15, + value_decimal: 0.15, products: [ { id: '123', diff --git a/test/integrations/destinations/reddit/router/data.ts b/test/integrations/destinations/reddit/router/data.ts index 317bb41a14..1ce7d24abf 100644 --- a/test/integrations/destinations/reddit/router/data.ts +++ b/test/integrations/destinations/reddit/router/data.ts @@ -234,7 +234,10 @@ export const data = [ screen_dimensions: {}, }, event_metadata: { - item_count: 3, + item_count: 2, + currency: 'USD', + value: 15, + value_decimal: 0.15, products: [ { id: '123', From edf24b4fa9ea977c247f10638c84049cf1055dbf Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 31 Jan 2024 05:47:15 +0000 Subject: [PATCH 2/3] chore(release): 1.54.4 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e0e09ac0f..0ee4007dba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [1.54.4](https://github.com/rudderlabs/rudder-transformer/compare/v1.54.3...v1.54.4) (2024-01-31) + + +### Bug Fixes + +* purchsse events for reddit ([56d24ec](https://github.com/rudderlabs/rudder-transformer/commit/56d24ec74c0c21bcdcdf262b4feec6edd1dff51c)) + ### [1.54.3](https://github.com/rudderlabs/rudder-transformer/compare/v1.54.2...v1.54.3) (2024-01-30) diff --git a/package-lock.json b/package-lock.json index 02d89bdfee..acde95fedf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.54.3", + "version": "1.54.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.54.3", + "version": "1.54.4", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index a52a77a393..28c66a76e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.54.3", + "version": "1.54.4", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From 1ec08da9ed6472607371768ee94597064e4c32eb Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Wed, 31 Jan 2024 16:57:09 +0530 Subject: [PATCH 3/3] fix: value and value_decimal to proper currency subunit measurement --- src/cdk/v2/destinations/reddit/procWorkflow.yaml | 4 ++-- test/integrations/destinations/reddit/processor/data.ts | 4 ++-- test/integrations/destinations/reddit/router/data.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cdk/v2/destinations/reddit/procWorkflow.yaml b/src/cdk/v2/destinations/reddit/procWorkflow.yaml index 652ee2f784..e6c05ef86d 100644 --- a/src/cdk/v2/destinations/reddit/procWorkflow.yaml +++ b/src/cdk/v2/destinations/reddit/procWorkflow.yaml @@ -60,9 +60,9 @@ steps: template: | const customFields = .message.().({ "currency": .properties.currency, - "value": .properties.revenue !== undefined ? Number(.properties.revenue) : undefined, + "value_decimal": .properties.revenue !== undefined ? Number(.properties.revenue) : undefined, "item_count": (Array.isArray(.properties.products) && .properties.products.length) || (.properties.itemCount && Number(.properties.itemCount)), - "value_decimal": .properties.revenue !== undefined ? Number(.properties.revenue)/100 : undefined, + "value": .properties.revenue !== undefined ? Number(.properties.revenue)*100 : undefined, "conversion_id": .properties.conversionId || .messageId, }); $.removeUndefinedAndNullValues(customFields) diff --git a/test/integrations/destinations/reddit/processor/data.ts b/test/integrations/destinations/reddit/processor/data.ts index 09bbd3e587..f3cd4ebf7b 100644 --- a/test/integrations/destinations/reddit/processor/data.ts +++ b/test/integrations/destinations/reddit/processor/data.ts @@ -128,8 +128,8 @@ export const data = [ event_metadata: { item_count: 2, currency: 'USD', - value: 15, - value_decimal: 0.15, + value: 1500, + value_decimal: 15, products: [ { id: '123', diff --git a/test/integrations/destinations/reddit/router/data.ts b/test/integrations/destinations/reddit/router/data.ts index 1ce7d24abf..e71b69b1fc 100644 --- a/test/integrations/destinations/reddit/router/data.ts +++ b/test/integrations/destinations/reddit/router/data.ts @@ -236,8 +236,8 @@ export const data = [ event_metadata: { item_count: 2, currency: 'USD', - value: 15, - value_decimal: 0.15, + value: 1500, + value_decimal: 15, products: [ { id: '123',