Skip to content

Commit

Permalink
fix: adding component test case part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouti1507 committed Feb 13, 2024
1 parent bd29ece commit d999698
Show file tree
Hide file tree
Showing 13 changed files with 1,676 additions and 883 deletions.
167 changes: 76 additions & 91 deletions src/cdk/v2/destinations/bluecore/data/bluecoreTrackConfig.json
Original file line number Diff line number Diff line change
@@ -1,92 +1,77 @@
[
{
"destKey": "properties.distinct_id",
"sourceKeys": [
"userId",
"anonymousId",
"email"
],
"required": false
},
{
"destKey": "properties.customer.name",
"sourceKeys": "name",
"required": false,
"sourceFromGenericMap": true
},
{
"destKey": "properties.customer.first_name",
"sourceKeys": "firstName",
"required": false,
"sourceFromGenericMap": true
},
{
"destKey": "properties.customer.last_name",
"sourceKeys": "lastName",
"required": false,
"sourceFromGenericMap": true
},
{
"destKey": "properties.customer.age",
"sourceKeys": [
"context.traits.age",
"traits.age"
],
"required": false
},
{
"destKey": "properties.customer.sex",
"sourceKeys": [
"traits.gender",
"context.traits.gender",
"traits.sex",
"context.traits.sex"
],
"required": false
},
{
"destKey": "properties.customer.address",
"sourceKeys": "address",
"required": false,
"sourceFromGenericMap": true
},
{
"destKey": "properties.customer.email",
"sourceKeys": "email",
"required": false,
"sourceFromGenericMap": true
},
{
"destKey": "properties.search_term",
"sourceKeys": "properties.query",
"required": false
},
{
"destKey": "properties.order_id",
"sourceKeys": "properties.order_id",
"required": false
},
{
"destKey": "properties.total",
"sourceKeys": "properties.total",
"required": false
},
{
"destKey": "properties.client",
"sourceKeys": "context.app.version",
"required": false
},
{
"destKey": "properties.device",
"sourceKeys": "context.device.model",
"required": false
},
{
"destKey": "properties.products",
"sourceKeys": [
"properties.products",
"properties"
],
"required": false
}
]
{
"destKey": "properties.distinct_id",
"sourceKeys": ["userId", "anonymousId", "email"],
"required": false
},
{
"destKey": "properties.customer.name",
"sourceKeys": "name",
"required": false,
"sourceFromGenericMap": true
},
{
"destKey": "properties.customer.first_name",
"sourceKeys": "firstName",
"required": false,
"sourceFromGenericMap": true
},
{
"destKey": "properties.customer.last_name",
"sourceKeys": "lastName",
"required": false,
"sourceFromGenericMap": true
},
{
"destKey": "properties.customer.age",
"sourceKeys": ["context.traits.age", "traits.age"],
"required": false
},
{
"destKey": "properties.customer.sex",
"sourceKeys": ["traits.gender", "context.traits.gender", "traits.sex", "context.traits.sex"],
"required": false
},
{
"destKey": "properties.customer.address",
"sourceKeys": "address",
"required": false,
"sourceFromGenericMap": true
},
{
"destKey": "properties.customer.email",
"sourceKeys": "email",
"required": false,
"sourceFromGenericMap": true
},
{
"destKey": "properties.search_term",
"sourceKeys": "properties.query",
"required": false
},
{
"destKey": "properties.order_id",
"sourceKeys": "properties.order_id",
"required": false
},
{
"destKey": "properties.total",
"sourceKeys": "properties.total",
"required": false
},
{
"destKey": "properties.client",
"sourceKeys": "context.app.version",
"required": false
},
{
"destKey": "properties.device",
"sourceKeys": "context.device.model",
"required": false
},
{
"destKey": "properties.products",
"sourceKeys": ["properties.products"],
"required": false
}
]
3 changes: 2 additions & 1 deletion src/cdk/v2/destinations/bluecore/procWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ steps:
const payload = $.constructProperties(.message);
$.context.payloads = $.outputs.deduceEventNames.(
const newPayload = cloneDeep(payload);
newPayload.properties.products = $.addProductArray(newPayload.properties.products, .);
const temporaryProductArray = newPayload.properties.products ?? $.createProductForStandardEcommEvent(.message.properties, .);
newPayload.properties.products = $.addProductArray(temporaryProductArray);
newPayload.event = eventName;
newPayload.token = ^.destination.Config.bluecoreNamespace;
$.verifyPayload(newPayload, ^.message);
Expand Down
Loading

0 comments on commit d999698

Please sign in to comment.