Skip to content

Commit

Permalink
Merge pull request #13 from appirio-tech/feature/sfdc-lead-update-phase2
Browse files Browse the repository at this point in the history
Added Direct Project Id as a part of Connect Lead Sync To SFDC
  • Loading branch information
vikasrohit authored May 25, 2017
2 parents 8b04e3c + f93841f commit da7e9a8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions consumer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ Use following JSON for testing
"code": "123"
}
},
"directProjectId": 5001,
"cancelReason":null,
"members": [
{
Expand All @@ -203,6 +204,7 @@ Use following JSON for testing
"updated": {
"id": 1,
"status": "active",
"directProjectId": 6001,
"cancelReason": "Spam",
"details": {
"utm": {
Expand Down
4 changes: 4 additions & 0 deletions consumer/src/services/ConsumerService.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ function getUpdatedLeadFieldData(projectUpdated) {
if (projectUpdated.details) {
updatedLead.Ref_Code__c = _.get(projectUpdated,"details.utm.code", "");
}
if (projectUpdated.directProjectId) {
updatedLead.TC_Connect_Direct_Project_Id__c = _.get(projectUpdated, "directProjectId","");
}

return updatedLead;
}
Expand Down Expand Up @@ -86,6 +89,7 @@ class ConsumerService {
TC_Connect_Project_Id__c: project.id,
TC_Connect_Project_Status__c: _.get(project,"status",""),
Ref_Code__c: _.get(project, "details.utm.code",""),
TC_Connect_Direct_Project_Id__c: _.get(project, "directProjectId",""),
TC_Connect_Cancel_Reason__c: _.get(project,"cancelReason","")
};
return SalesforceService.createObject('Lead', lead, accessToken, instanceUrl)
Expand Down
3 changes: 2 additions & 1 deletion consumer/test/ConsumerService.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ describe('ConsumerService', () => {
TC_Connect_Project_Id__c: 1,
Ref_Code__c: '123',
TC_Connect_Project_Status__c: '',
TC_Connect_Cancel_Reason__c: null
TC_Connect_Cancel_Reason__c: null,
TC_Connect_Direct_Project_Id__c: ''
};

const expectedCampaignMember = {
Expand Down

0 comments on commit da7e9a8

Please sign in to comment.