Repository navigation
feat: support shifts that cross midnight - #60
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
Merged
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
Review finding C11:
calculate_daily_hoursgave negative hours for a shift that crosses midnight, and the validators rejected it, so there was no way to log a night shift.Rule: a time range whose exit is earlier than its entry ends the next day, and its hours count for the day the shift started (22:00 - 06:00 is 8 hours).
calculate_daily_hoursadds a day to a negative range.validate_entriesaccepts that range only if it is the one that starts last (any later range would overlap it), and at most one per day. Equal entry and exit is now the invalid case ("Exit time must be different from entry time").Type of Change
Testing
pytest(257 passed),black,isort,mypyclean.Screenshots
Day panel with a night shift (preview 8:30 and the new hint), and the calendar after saving.
Checklist