Repository navigation
feat(tempo): add timesheet approval commands for period locking - #138
Merged
Merged
Conversation
Add a 'tempo timesheet' sub-group (status, submit, approve, reopen) that
drives Tempo Cloud's timesheet-approval workflow: an APPROVED timesheet
locks the period against further bookings and edits, which is how a
month gets closed for booking. Tempo exposes no period-closing endpoint,
so the approval workflow is the lock.
- TempoClient: get_timesheet_approval plus submit/approve/reject/reopen
action methods against /4/timesheet-approvals/user/{accountId}
- CLI: --period YYYY-MM (whole month) or explicit --from/--to; write
commands fetch the status first and refuse with a clear message when
the action is not in the approval's actions map, then print the
resulting state so the lock is visible; --format json supported
- Planning-only connections (Tempo disabled) error out clearly
Refs #137
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.
Summary
Implements #137:
budjira tempo timesheet status|submit|approve|reopen— lock a month against further bookings via the Tempo timesheet-approval workflow (Tempo Cloud exposes no admin-side period closing via REST; an approved timesheet is locked).--period YYYY-MM(whole month) or explicit--from/--to, with clear validation errorsstatusprints state, required vs. booked hours, and the actions currently allowed for the callersubmit/approve/reopenfetch the approval status first and refuse with an actionable message when the action is not in theactionsmap; the resulting state is printed after each write so the lock is visible--commentonsubmit/approve; JSON output mode supported on all four commandstempo_enabled— planning-only connections error outTempoClientalso coversreject_timesheet()(client-level only, no CLI command, as proposed in the issue)Tests
48 new tests (client, models, CLI incl. error paths and refusal matrix). Full suite: 1366 passed, 3 skipped; coverage 89% overall, 95–100% on new code. All pre-commit hooks green.
Closes #137