Shaulbm / moovNowMVP

0 stars 0 forks source link

getTeamStateAggData #618

Closed Shaulbm closed 3 months ago

Shaulbm commented 7 months ago

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)