Skip to content

Nirali: core team members additional hours carryover#2216

Open
Nirali164 wants to merge 1 commit into
developmentfrom
nirali-core-team-members-hours
Open

Nirali: core team members additional hours carryover#2216
Nirali164 wants to merge 1 commit into
developmentfrom
nirali-core-team-members-hours

Conversation

@Nirali164
Copy link
Copy Markdown

Screenshot 2026-05-14 at 2 45 59 PM Screenshot 2026-05-14 at 2 46 13 PM

Description

Implements the fix for Core Team members’ missed hours carryover logic when blue squares exceed five. Previously, missed hours were carried over to the next week, but the additional hours associated with having more than five blue squares were not consistently included in the following week’s required commitment. This update ensures Core Team members receive additional required hours based on their blue square count (e.g., 6th blue square = +1 hour, 7th blue square = +2 hours), and those hours are carried into subsequent weeks correctly. Email messaging and infringement descriptions were also updated to accurately reflect the required weekly commitment and owed hours.

Implements: PRIORITY MEDIUM - Yubo/Jae: Make Core Team members’ additional hours process properly (Fixes #1141 & #1281 → PR #1612)

#Related PRs (if any):
#Frontend PR: N/A
Backend PR: This PR

Main changes explained:
Updated applyMissedHourForCoreTeam() to include additional Core Team hours when blue squares exceed five.
Added infringement adjustment logic to calculate extra required hours based on blue square count.
Updated assignBlueSquareForTimeNotMet() to include carried-over Core Team additional hours in weekly commitment calculations.
Fixed weekly required hour calculations to include:
committed weekly hours
previous missed hours
additional Core Team hours (after 5 blue squares)
Updated infringement descriptions to reflect accurate completed vs required hours for Core Team members.
Updated getInfringementEmailBody() to correctly display required hours and prevent double-counting of additional Core Team hours.
Added batch processing (bulkWrite) for updating missed hours to reduce database operations and improve efficiency.

How to test:
Check out the current branch:
git checkout nirali-core-team-members-hours
npm install
npm start

  1. Clear browser cache/site data.
  2. Log in as an admin user.
  3. Create or use a Core Team member with:
  4. more than 5 blue squares
  5. weekly committed hours set
  6. previous missed hours
  7. Log fewer hours than required for the week.
  8. Run the blue square/missed hours cron logic.
  9. Verify:
  10. missed hours carry over correctly
  11. additional Core Team hours are included (6th blue square = +1, 7th = +2, etc.)
  12. Next week's required hours are calculated correctly
  13. infringement descriptions show the required hours
  14. blue square emails display the correct owed hours without duplication
  15. Test edge cases:
  16. Core Team member with fewer than 5 blue squares
  17. Core Team member with exactly 6th and 7th blue square
  18. User meeting all required hours

Note:

The fix ensures Core Team-specific additional hour rules are consistently applied across missed hour carryover, weekly commitment validation, infringement descriptions, and blue square email calculations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant