Repository navigation
feat(leave): set the leave break with --less, and keep a partial day's window on update - #102
Open
bradystroud wants to merge 1 commit into
Open
bradystroud wants to merge 1 commit into
bradystroud wants to merge 1 commit into
Conversation
…s window on update EasyLeave deducts the employee's lunch break from every leave day, so a 09:00-13:00 half day counts 3 hours. The API takes TimeLessOverride (hours) to replace that deduction, but no CLI or MCP surface could set it. - tp leave create and tp leave update take --less <MINUTES>; update also takes --clear-less to go back to the lunch-break default - MCP CreateLeave and UpdateLeave take lessMinutes; UpdateLeave takes clearLess - Updating a partial-day request no longer widens it to the profile workday. The list response omits UserStartTime/UserEndTime, so the window now comes from the request's own start and end Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rf633EiNySafrMCHZnMM7W
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.
Problem
EasyLeave deducts the employee's lunch break from every leave day. A 09:00-13:00 half day therefore counts 3 hours, not 4. The API accepts
TimeLessOverrideto replace that deduction, but no CLI or MCP surface could set it, so the only fix was the web UI.Change
tp leave createandtp leave updatetake--less <MINUTES>.--less 0means no break.tp leave updatealso takes--clear-lessto go back to the lunch-break default.CreateLeave/UpdateLeavetakelessMinutes, andUpdateLeavetakesclearLess.tp ts create --less. The services convert it to hours. In the backend,TimeLessOverrideis in hours (LeaveEntrysubtractsTimeSpan.FromHours).0means no break, andnullmeans the lunch-break deduction. The leave timesheets take theirlessfrom it too (TimesheetsDto.FromLeave).Bug fix found on the way
Before this change, an update to a partial-day request without
--start-time/--end-timechanged its window to the profile workday. The list response does not returnUserStartTime/UserEndTime, soLeaveUpdateServiceused the profile hours and calculated the partial-day start and end from them. A dry run of--less 0on a real 09:00-13:00 request showed 08:00-17:00. Now, when a request stays partial-day, the update keeps the window from the request's own start and end.Verification
--less0 / 30 / 60 converts to hours,--clear-lesssendsnull, invalid values and--lesstogether with--clear-lessare rejected, create with and without--less, and a partial-day request with no stored workday times keeps 09:00-13:00.dotnet test: 611 unit and 305 integration tests pass. The MCP discovery goldens were regenerated for the new parameters.timeLessOverride: 0.Docs:
AGENTS.md(units and meaning ofTimeLessOverride), the README and the timesheet skill template. I did not write release notes, because they are written at release time.Small, low-risk change, so it did not need a plan review.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Rf633EiNySafrMCHZnMM7W