Conversation
Collaborator
|
closed/opened to re-run the test |
niraj2477
approved these changes
Jul 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 PR refactors the
update_weekly_status_of_timesheetutility to use aper-day priority-basedapproach for determining the overall weekly approval status.Previously, the weekly status was derived based on the total count of timesheets, which led to inaccurate results when users created multiple timesheets on the same day.
For example:
A user creates 1 timesheet each for Monday to Wednesday and 2 timesheets on Thursday, resulting in 5 timesheets.
If the employee's working days are also 5, the system considers the quota met and marks the week as "Approved" once these are approved by the manager.
However, the user is then unable to add a timesheet on Friday, which is a valid working day.
To resolve this:
We now evaluate daily statuses based on the highest priority status among all timesheets for a given day.
Weekly status is derived from the distribution of these daily statuses, ensuring accurate and fair handling of timesheet approvals.
This approach eliminates issues arising from multiple timesheets on the same day and respects the actual working day count for the employee.
Relevant Technical Choices
Testing Instructions
Additional Information:
Screenshot/Screencast
Checklist