Skip to content

Commit

Permalink
fix: rakuten: sync property mapping sourcekeys to rudderstack standar…
Browse files Browse the repository at this point in the history
…d spec (#3129)

* fix: rakuten: sync property mapping sourcekeys to rudderstack standard spec

* chore: comments addressed
  • Loading branch information
anantjain45823 committed Feb 27, 2024
1 parent 108cbba commit 2ebff95
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 21 deletions.
76 changes: 58 additions & 18 deletions src/cdk/v2/destinations/rakuten/data/propertiesMapping.json
@@ -1,41 +1,50 @@
[
{
"sourceKeys": "properties.orderId",
"sourceKeys": ["properties.order_id", "properties.orderId"],
"required": true,
"destKey": "ord"
},
{
"sourceKeys": ["properties.tr", "properties.ranSiteID"],
"sourceKeys": ["properties.tr", "properties.ran_site_id", "properties.ranSiteID"],
"required": true,
"destKey": "tr"
},
{
"sourceKeys": ["properties.land", "properties.landTime"],
"sourceKeys": ["properties.land", "properties.land_time", "properties.landTime"],
"required": true,
"destKey": "land"
},
{
"sourceKeys": ["properties.date", "properties.orderCompletedTime"],
"sourceKeys": [
"properties.date",
"properties.order_completed_time",
"properties.orderCompletedTime"
],
"destKey": "date"
},
{
"sourceKeys": ["properties.altord", "properties.alterOrderId"],
"sourceKeys": [
"properties.alt_ord",
"properties.altord",
"properties.alter_order_id",
"properties.alterOrderId"
],
"destKey": "altord"
},
{
"sourceKeys": "properties.currency",
"destKey": "cur"
},
{
"sourceKeys": "properties.creditCardType",
"sourceKeys": ["properties.credit_card_type", "properties.creditCardType"],
"destKey": "cc"
},
{
"sourceKeys": "properties.commReason",
"sourceKeys": ["properties.comm_reason", "properties.commReason"],
"destKey": "commreason"
},
{
"sourceKeys": "properties.isComm",
"sourceKeys": ["properties.is_comm", "properties.isComm"],
"destKey": "iscomm"
},
{
Expand All @@ -47,51 +56,82 @@
"destKey": "coupon"
},
{
"sourceKeys": ["properties.custId", "properties.customerId", "properties.userId"],
"sourceKeys": [
"properties.cust_id",
"properties.custId",
"properties.customer_id",
"properties.customerId",
"properties.userId"
],
"destKey": "custid"
},
{
"sourceKeys": ["properties.custScore", "properties.customerScore"],
"sourceKeys": [
"properties.cust_score",
"properties.custScore",
"properties.customer_score",
"properties.customerScore"
],
"destKey": "custscore"
},
{
"sourceKeys": ["properties.custStatus", "properties.customerStatus"],
"sourceKeys": [
"properties.cust_status",
"properties.custStatus",
"properties.customer_status",
"properties.customerStatus"
],
"destKey": "custstatus"
},
{
"sourceKeys": ["properties.dId", "properties.advertisingId"],
"sourceKeys": ["properties.dId", "properties.advertising_id", "properties.advertisingId"],
"destKey": "did"
},
{
"sourceKeys": ["properties.disamt", "properties.discountAmout"],
"sourceKeys": ["properties.disamt", "properties.discount_amount", "properties.discountAmount"],
"destKey": "disamt"
},
{
"sourceKeys": ["properties.ordStatus", "properties.orderStatus"],
"sourceKeys": [
"properties.ord_status",
"properties.ordStatus",
"properties.order_status",
"properties.orderStatus"
],
"destKey": "ordstatus"
},
{
"sourceKeys": "properties.segment",
"destKey": "segment"
},
{
"sourceKeys": "properties.shipcountry",
"sourceKeys": ["properties.ship_country", "properties.shipcountry"],
"destKey": "shipcountry"
},
{
"sourceKeys": "properties.shipped",
"destKey": "shipped"
},
{
"sourceKeys": ["properties.sitename", "properties.url", "context.page.url"],
"sourceKeys": [
"properties.site_name",
"properties.sitename",
"properties.url",
"context.page.url"
],
"destKey": "sitename"
},
{
"sourceKeys": "properties.storeId",
"sourceKeys": ["properties.store_id", "properties.storeId"],
"destKey": "storeid"
},
{
"sourceKeys": ["properties.storecat", "properties.storeCategory"],
"sourceKeys": [
"properties.store_cat",
"properties.storecat",
"properties.store_category",
"properties.storeCategory"
],
"destKey": "storecat"
},
{
Expand Down
Expand Up @@ -46,7 +46,7 @@ export const transformationFailures = [
body: [
{
error:
'Missing required value from "properties.orderId": Workflow: procWorkflow, Step: prepareTrackPayload, ChildStep: undefined, OriginalError: Missing required value from "properties.orderId"',
'Missing required value from ["properties.order_id","properties.orderId"]: Workflow: procWorkflow, Step: prepareTrackPayload, ChildStep: undefined, OriginalError: Missing required value from ["properties.order_id","properties.orderId"]',
metadata: {
destinationId: 'dummyDestId',
jobId: '1',
Expand Down Expand Up @@ -245,7 +245,7 @@ export const transformationFailures = [
body: [
{
error:
'Missing required value from ["properties.tr","properties.ranSiteID"]: Workflow: procWorkflow, Step: prepareTrackPayload, ChildStep: undefined, OriginalError: Missing required value from ["properties.tr","properties.ranSiteID"]',
'Missing required value from ["properties.tr","properties.ran_site_id","properties.ranSiteID"]: Workflow: procWorkflow, Step: prepareTrackPayload, ChildStep: undefined, OriginalError: Missing required value from ["properties.tr","properties.ran_site_id","properties.ranSiteID"]',
metadata: {
destinationId: 'dummyDestId',
jobId: '1',
Expand Down Expand Up @@ -312,7 +312,7 @@ export const transformationFailures = [
body: [
{
error:
'Missing required value from ["properties.land","properties.landTime"]: Workflow: procWorkflow, Step: prepareTrackPayload, ChildStep: undefined, OriginalError: Missing required value from ["properties.land","properties.landTime"]',
'Missing required value from ["properties.land","properties.land_time","properties.landTime"]: Workflow: procWorkflow, Step: prepareTrackPayload, ChildStep: undefined, OriginalError: Missing required value from ["properties.land","properties.land_time","properties.landTime"]',
metadata: {
destinationId: 'dummyDestId',
jobId: '1',
Expand Down

0 comments on commit 2ebff95

Please sign in to comment.