Skip to content

Conversation

@bkarimii
Copy link
Owner

@bkarimii bkarimii commented Jul 12, 2025

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:

  • Refactored scoreNormaliser:

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.

  • Enhanced decideStatus:

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).

  • Updated /users/status-counts endpoint:

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:

  • My code follows the style guidelines of this project
  • I have carefully reviewed my own code
  • I have commented my code
  • I have updated any documentation

@bkarimii bkarimii self-assigned this Jul 12, 2025
@bkarimii bkarimii changed the title Link user information to activity scores and group users by status Link user information to activity scores and group users by status - #131 Jul 12, 2025
@bkarimii bkarimii moved this from In progress to In Code Review in Final Projects Board-Slack-Dashboard Jul 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Code Review

Development

Successfully merging this pull request may close these issues.

Display user identity per activity status based on normalised scores

2 participants