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.
I have added the possibility to also check the previous day. The "PastDayNotComplete" class also takes into account wheter the past day was a weekend or not. If so, the past friday will be checked instead of sunday.
I have also extended the endpoint /api/timesheet/remind with additional parameters to specify what needs to be checked.
Without adding anything, the behaviour will be the exact same as it was before. Just checking for todays work and also respecting the working hours.
To be able to remind a user during the day for the badness of not adding the hours yesterday, we must be able to not respect the working hours and remind him also during the day. Therefore i added the "respectWorkingHours" variable and also the parameters.
This is, how one can now trigger the endpoint:
This will remind him for todays and yesterdays hours without respecting the working hours
api/timesheet/remind?type=yesterday&type=today&respectWorkingHours=false
This will remind him for todays hours and also for yesterdays while respecting the working hours
api/timesheet/remind?type=yesterday&type=today
This will remind him for todays hours only while respecting the working hours
api/timesheet/remind?type=today