Skip to content

Commit e5b9a62

Browse files
author
Vikas Agarwal
committed
git#651-Return BA status in the GET billing account endpoint
1 parent 85eddc4 commit e5b9a62

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

config/development.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
"identityServiceEndpoint": "https://api.topcoder-dev.com/v3/",
1010
"taasJobApiUrl": "https://api.topcoder-dev.com/v5/jobs",
1111
"sfdcBillingAccountNameField": "Billing_Account_Name__c",
12-
"sfdcBillingAccountMarkupField": "Mark_Up__c"
12+
"sfdcBillingAccountMarkupField": "Mark_Up__c",
13+
"sfdcBillingAccountActiveField": "Active__c"
1314
}

config/production.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"authDomain": "topcoder.com",
33
"connectProjectsUrl": "https://connect.topcoder.com/projects/",
44
"sfdcBillingAccountNameField": "Billing_Account_name__c",
5-
"sfdcBillingAccountMarkupField": "Mark_up__c"
5+
"sfdcBillingAccountMarkupField": "Mark_up__c",
6+
"sfdcBillingAccountActiveField": "Active__c"
67
}

src/routes/billingAccounts/get.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module.exports = [
4242
}
4343
const { accessToken, instanceUrl } = await SalesforceService.authenticate();
4444
// eslint-disable-next-line
45-
const sql = `SELECT TopCoder_Billing_Account_Id__c, Mark_Up__c from Topcoder_Billing_Account__c tba where TopCoder_Billing_Account_Id__c='${billingAccountId}'`;
45+
const sql = `SELECT TopCoder_Billing_Account_Id__c, Mark_Up__c, Active__c from Topcoder_Billing_Account__c tba where TopCoder_Billing_Account_Id__c='${billingAccountId}'`;
4646
req.log.debug(sql);
4747
const billingAccount = await SalesforceService.queryBillingAccount(sql, accessToken, instanceUrl, req.log);
4848
res.json(billingAccount);

src/services/salesforceService.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class SalesforceService {
102102
null, // fallback to null if cannot parse
103103
),
104104
markup: _.get(o, config.get('sfdcBillingAccountMarkupField')),
105+
active: _.get(o, config.get('sfdcBillingAccountActiveField')),
105106
}));
106107
return billingAccounts.length > 0 ? billingAccounts[0] : {};
107108
});

0 commit comments

Comments
 (0)