Skip to content

Commit

Permalink
chore: add missing country field mapping & modify relevant tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sai Sankeerth <[email protected]>
  • Loading branch information
Sai Sankeerth committed Dec 1, 2023
1 parent 20d577d commit 1eb4679
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@
},
{
"destKey": "country",
"sourceKeys": ["traits.address.country", "context.traits.address.country"],
"sourceKeys": [
"traits.address.country",
"context.traits.address.country",
"context.geo.country"
],
"required": false,
"metadata": {
"type": ["toLower", "hashToSha256"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@
},
{
"destKey": "country",
"sourceKeys": ["traits.address.country", "context.traits.address.country"],
"sourceKeys": [
"traits.address.country",
"context.traits.address.country",
"context.geo.country"
],
"required": false,
"metadata": {
"type": ["toLower", "hashToSha256"]
Expand Down
3 changes: 2 additions & 1 deletion src/v0/destinations/freshsales/data/groupConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
"traits.address.country",
"traits.country",
"context.traits.address.country",
"context.traits.country"
"context.traits.country",
"context.geo.country"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion test/__tests__/data/facebook_conversions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@
"JSON_ARRAY": {},
"FORM": {
"data": [
"{\"user_data\":{\"em\":\"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08\",\"ct\":\"a59f6598a62478c05e206d83593f510080816c99f4d0a3c90c59b2567d3f758a\",\"st\":\"92db9c574d420b2437b29d898d55604f61df6c17f5163e53337f2169dd70d38d\",\"zp\":\"298a8ea2e8e6ca9168b40659e8240af20b78c8b10a07fd514a4956d78ea1ad54\",\"client_ip_address\":\"223.190.82.63\"},\"event_name\":\"Purchase\",\"event_time\":1699784211,\"action_source\":\"website\",\"custom_data\":{\"revenue\":400,\"additional_bet_index\":0,\"delivery_category\":\"home_delivery\",\"products\":[{\"product_id\":1234,\"quantity\":5,\"price\":55}],\"content_ids\":[1234],\"contents\":[{\"id\":1234,\"quantity\":5,\"item_price\":55,\"delivery_category\":\"home_delivery\"}],\"content_type\":\"product\",\"currency\":\"USD\",\"value\":400,\"num_items\":1}}"
"{\"user_data\":{\"em\":\"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08\",\"ct\":\"a59f6598a62478c05e206d83593f510080816c99f4d0a3c90c59b2567d3f758a\",\"st\":\"92db9c574d420b2437b29d898d55604f61df6c17f5163e53337f2169dd70d38d\",\"zp\":\"298a8ea2e8e6ca9168b40659e8240af20b78c8b10a07fd514a4956d78ea1ad54\",\"country\":\"582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf\",\"client_ip_address\":\"223.190.82.63\"},\"event_name\":\"Purchase\",\"event_time\":1699784211,\"action_source\":\"website\",\"custom_data\":{\"revenue\":400,\"additional_bet_index\":0,\"delivery_category\":\"home_delivery\",\"products\":[{\"product_id\":1234,\"quantity\":5,\"price\":55}],\"content_ids\":[1234],\"contents\":[{\"id\":1234,\"quantity\":5,\"item_price\":55,\"delivery_category\":\"home_delivery\"}],\"content_type\":\"product\",\"currency\":\"USD\",\"value\":400,\"num_items\":1}}"
]
}
},
Expand Down
1 change: 1 addition & 0 deletions test/__tests__/data/freshsales.json
Original file line number Diff line number Diff line change
Expand Up @@ -2254,6 +2254,7 @@
"number_of_employees": 51,
"annual_revenue": 1000,
"city": "Gurugram",
"country": "IN",
"state": "Haryana",
"zipcode": "122001",
"created_at": "2022-06-22T10:57:58Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6581,7 +6581,7 @@ export const data = [
XML: {},
FORM: {
data: [
'{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","ct":"a59f6598a62478c05e206d83593f510080816c99f4d0a3c90c59b2567d3f758a","st":"92db9c574d420b2437b29d898d55604f61df6c17f5163e53337f2169dd70d38d","zp":"298a8ea2e8e6ca9168b40659e8240af20b78c8b10a07fd514a4956d78ea1ad54","client_ip_address":"223.190.82.63"},"event_name":"spin_result","event_time":1697221800,"action_source":"app","custom_data":{"additional_bet_index":0,"value":400,"content_ids":["prod1","prod2"]}}',
'{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","ct":"a59f6598a62478c05e206d83593f510080816c99f4d0a3c90c59b2567d3f758a","st":"92db9c574d420b2437b29d898d55604f61df6c17f5163e53337f2169dd70d38d","zp":"298a8ea2e8e6ca9168b40659e8240af20b78c8b10a07fd514a4956d78ea1ad54","country":"582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf","client_ip_address":"223.190.82.63"},"event_name":"spin_result","event_time":1697221800,"action_source":"app","custom_data":{"additional_bet_index":0,"value":400,"content_ids":["prod1","prod2"]}}',
],
},
},
Expand Down

0 comments on commit 1eb4679

Please sign in to comment.