Link user information to activity scores and group users by status - #131 #130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request refactors and extends the user activity scoring and status classification logic to improve data traceability and enable admin insights. Key changes include:
Now returns an array of user objects with userId, name, email, and their normalised score.
Keeps the score calculation logic intact, but improves readability and traceability.
Instead of just returning counts, it now groups users into inactive, low, medium, and high activity levels.
Each group contains the full user object (with ID, name, email, and score).
Returns statusCounts, usersByStatus, and boxPlotData in a single response.
Enables frontend tools to display user names/emails under each activity level.
Related to
Fixes #131
Checklist: