File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed 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 @@ -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