Skip to content

feat(tempo): add timesheet approval commands for period locking - #138

Merged
f3rdy merged 2 commits into
masterfrom
feat/tempo-timesheet
Sep 23, 2026
Merged

f3rdy merged 2 commits into
masterfrom
feat/tempo-timesheet

Conversation

@f3rdy

@f3rdy f3rdy commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

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 errors
  • status prints state, required vs. booked hours, and the actions currently allowed for the caller
  • submit/approve/reopen fetch the approval status first and refuse with an actionable message when the action is not in the actions map; the resulting state is printed after each write so the lock is visible
  • --comment on submit/approve; JSON output mode supported on all four commands
  • Respects tempo_enabled — planning-only connections error out
  • TempoClient also covers reject_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

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
@f3rdy
f3rdy merged commit ece8aa8 into master Sep 23, 2026
5 checks passed
@f3rdy
f3rdy deleted the feat/tempo-timesheet branch September 23, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tempo: submit and approve a timesheet period (lock a month against further bookings)

1 participant