The data we need to return is a list of Cultures:
[
{id : "",
impact: 0..100,
score: 0..100,
drivers:[
{id: "",
impact: 0..100,
score: 0..100}]
}
]
prepare data:
get all cultures, get all motivations
create a map for each drivers in which cultures it blong:
driverId: [cultureId. cultureId,...]
create a map for the cultures:
cultureId: {
accumalatedScore: 0...*,
uniqueUsersList: [userId#1, userId#2,...],
drivers: {
driverId: {
uniqueUsersList: [{
userId#1:score},
{userId#2:score},
...],
}}}
Get all users under the specific user (or all for HR)
for each user, for each driver -
add all the relevant cultures to userCultures (at the end, get unique list and add the user Id to it)
add driver to the relevant cultures, with the score.
calculate the levels for each culture:
score: accumlated score / number of drivers - normalized to 100%
impact: TBD (drivers number, users number, number of total possible drivers for this culture)
For each driver-
score: accumlated score / number of drivers - normalized to 100%
impact: TBD (drivers number, users number, number of total possible drivers for this culture)
The data we need to return is a list of Cultures: [ {id : "", impact: 0..100, score: 0..100, drivers:[ {id: "", impact: 0..100, score: 0..100}] } ]
prepare data: get all cultures, get all motivations
create a map for each drivers in which cultures it blong: driverId: [cultureId. cultureId,...]
create a map for the cultures: cultureId: { accumalatedScore: 0...*, uniqueUsersList: [userId#1, userId#2,...], drivers: { driverId: { uniqueUsersList: [{ userId#1:score}, {userId#2:score}, ...], }}}
Get all users under the specific user (or all for HR)
for each user, for each driver -
calculate the levels for each culture: score: accumlated score / number of drivers - normalized to 100% impact: TBD (drivers number, users number, number of total possible drivers for this culture)
For each driver- score: accumlated score / number of drivers - normalized to 100% impact: TBD (drivers number, users number, number of total possible drivers for this culture)