File tree Expand file tree Collapse file tree 4 files changed +19
-3
lines changed Expand file tree Collapse file tree 4 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -186,9 +186,10 @@ module.exports = {
186
186
BASE_URL : process . env . WEEKLY_SURVEY_BASE_URL || 'https://api.surveymonkey.net/v3/surveys' ,
187
187
JWT_TOKEN : process . env . WEEKLY_SURVEY_JWT_TOKEN || '' ,
188
188
SURVEY_ID : process . env . WEEKLY_SURVEY_SURVEY_ID || '' ,
189
+ SURVEY_COLLECTOR_PREFIX : process . env . WEEKLY_SURVEY_SURVEY_COLLECTOR_PREFIX || 'Week ending' ,
189
190
SURVEY_MASTER_COLLECTOR_ID : process . env . WEEKLY_SURVEY_SURVEY_MASTER_COLLECTOR_ID || '' ,
190
191
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 || '' ,
192
193
} ,
193
194
// payment scheduler config
194
195
PAYMENT_PROCESSING : {
Original file line number Diff line number Diff line change @@ -5624,6 +5624,18 @@ components:
5624
5624
isExternalMember :
5625
5625
type : boolean
5626
5626
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"
5627
5639
skillsMatch :
5628
5640
type : number
5629
5641
format : float
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ function getSingleItem (lst, errorMessage) {
57
57
* format `Week Ending yyyy-nth(weeks)`
58
58
*/
59
59
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' )
61
61
}
62
62
63
63
/*
Original file line number Diff line number Diff line change @@ -803,8 +803,11 @@ async function getRoleBySkills (skills) {
803
803
const roles = await Role . findAll ( queryCriteria )
804
804
if ( roles . length > 0 ) {
805
805
let result = _ . each ( roles , role => {
806
+ // role matched skills list
807
+ role . matchedSkills = _ . intersection ( role . listOfSkills , skills )
808
+ role . unMatchedSkills = _ . difference ( skills , role . matchedSkills )
806
809
// calculate each found roles matching rate
807
- role . skillsMatch = _ . intersection ( role . listOfSkills , skills ) . length / skills . length
810
+ role . skillsMatch = role . matchedSkills . length / skills . length
808
811
// each role can have multiple rates, get the maximum of global rates
809
812
role . maxGlobal = _ . maxBy ( role . rates , 'global' ) . global
810
813
} )
You can’t perform that action at this time.
0 commit comments