fix: don't consider default shift in overlapping period if curr shift is found #709
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.
Problem
Test Security shift
Time: 08:00:00 - 19:00:00
Begin check-in before shift start time (in minutes): 60
Allow check-out after shift end time (in minutes): 60
Actual time considering allowance: 07:00:00 - 20:00:00
Test Security - Night shift
Time: 19:00:00 - 07:00:00
Begin check-in before shift start time (in minutes): 60
Allow check-out after shift end time (in minutes): 60
Actual time considering allowance: 18:00:00 - 8:00:00
Employee has Night shift assigned on 1st June 2023, this is also applicable till 2nd June 8 AM. The employee has Test Security set as the default shift.
Checkin created at 02-06-2023 07:20:00. Fetches Test Security shift (default shift)
Ideally default shift should only be considered if the assigned shift is not found. Here the assigned shift is applicable till 02-06-2023 08:00:00
Solution
Don't consider default shift in the overlapping period if current shift is already fetched
Default shift is supposed to be used as a fallback