Skip to content

Commit d28dfe0

Browse files
Merge branch 'dev' into migrate-jobcandidates-scripts
2 parents fc86113 + 4b2e814 commit d28dfe0

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

config/default.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,10 @@ module.exports = {
186186
BASE_URL: process.env.WEEKLY_SURVEY_BASE_URL || 'https://api.surveymonkey.net/v3/surveys',
187187
JWT_TOKEN: process.env.WEEKLY_SURVEY_JWT_TOKEN || '',
188188
SURVEY_ID: process.env.WEEKLY_SURVEY_SURVEY_ID || '',
189+
SURVEY_COLLECTOR_PREFIX: process.env.WEEKLY_SURVEY_SURVEY_COLLECTOR_PREFIX || 'Week ending',
189190
SURVEY_MASTER_COLLECTOR_ID: process.env.WEEKLY_SURVEY_SURVEY_MASTER_COLLECTOR_ID || '',
190191
SURVEY_MASTER_MESSAGE_ID: process.env.WEEKLY_SURVEY_SURVEY_MASTER_MESSAGE_ID || '',
191-
SURVEY_CONTACT_GROUP_ID: process.env.WEEKLY_SURVEY_SURVEY_CONTACT_GROUP_ID || ''
192+
SURVEY_CONTACT_GROUP_ID: process.env.WEEKLY_SURVEY_SURVEY_CONTACT_GROUP_ID || '',
192193
},
193194
// payment scheduler config
194195
PAYMENT_PROCESSING: {

docs/swagger.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5624,6 +5624,18 @@ components:
56245624
isExternalMember:
56255625
type: boolean
56265626
description: "Is the user external member"
5627+
matchedSkills:
5628+
type: array
5629+
items:
5630+
type: string
5631+
example: "java"
5632+
description: "skills match with the role"
5633+
unMatchedSkills:
5634+
type: array
5635+
items:
5636+
type: string
5637+
example: "javascript"
5638+
description: "skills unmatch with the role"
56275639
skillsMatch:
56285640
type: number
56295641
format: float

src/common/surveyMonkey.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function getSingleItem (lst, errorMessage) {
5757
* format `Week Ending yyyy-nth(weeks)`
5858
*/
5959
function getCollectorName (dt) {
60-
return 'Week Ending ' + moment(dt).format('M/D/YYYY')
60+
return config.WEEKLY_SURVEY.SURVEY_COLLECTOR_PREFIX + ' ' + moment(dt).format('M/D/YYYY')
6161
}
6262

6363
/*

src/services/TeamService.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,8 +803,11 @@ async function getRoleBySkills (skills) {
803803
const roles = await Role.findAll(queryCriteria)
804804
if (roles.length > 0) {
805805
let result = _.each(roles, role => {
806+
// role matched skills list
807+
role.matchedSkills = _.intersection(role.listOfSkills, skills)
808+
role.unMatchedSkills = _.difference(skills, role.matchedSkills)
806809
// calculate each found roles matching rate
807-
role.skillsMatch = _.intersection(role.listOfSkills, skills).length / skills.length
810+
role.skillsMatch = role.matchedSkills.length / skills.length
808811
// each role can have multiple rates, get the maximum of global rates
809812
role.maxGlobal = _.maxBy(role.rates, 'global').global
810813
})

0 commit comments

Comments
 (0)