Fix/noid/sick leave type and job cutoffs - #42
Merged
Conversation
The method's own docblock said it was "used by the create flow to warn about (not block) negative balances". Nothing called it. That warning is a client-side one — §5.1 puts it in the request dialog, and RequestDialog.vue computes it from the balance the store already holds — so the method was not an unfinished feature but a pointer at the wrong layer, complete with a local that was assigned and never read. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ReportController::sickLeave() has always accepted a typeId, and ReportService documents that "HR can pass an explicit type instead" of the seeded `sick` key — but no caller ever sent one, so on an instance with no type keyed `sick` the page could only show a table of zeroes and say the type was missing. api.js now forwards typeId and the view offers a type picker, cleared by default so the server keeps resolving `sick` on its own. The three labels that named sickness outright now follow whatever the report says it aggregated, so picking Unpaid leave no longer leaves the page reading "days of sick leave". In the default case they resolve to the same wording as before. The options come from the full leave-type list rather than the enabled subset, for the same reason HrAbsences does it: a disabled type can still have history worth reporting on. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
created_at holds UTC — ClockService::now() is deliberately UTC, because a timestamp records an instant rather than a day. The escalation and reminder jobs, equally deliberately, work their cut-offs out on the server's calendar: which day a request falls on is a company question. Formatting such a cut-off straight into the query wrote its local wall-clock and silently shifted every bound by the server's UTC offset. Escalation only slipped by hours, but the reminder band is exactly one working day wide, so off Berlin's or Auckland's offset it reminded a cohort a day early or skipped it altogether. Converted in the mapper, which is the layer that knows what the column holds, so both queries are covered at once. Rebuilt from the timestamp rather than via setTimezone() so a caller's mutable DateTime is never altered underneath it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
🤖 AI (if applicable)