Skip to content

Commit 4b2e814

Browse files
authored
Merge pull request #450 from yoution/taas-issue-412
fix: taas issue-412
2 parents 965ff50 + 045af53 commit 4b2e814

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

docs/swagger.yaml

+12
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/services/TeamService.js

+4-1
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)