Skip to content

Add timesheet entry CRUD commands and clock shortcut#129

Merged
jeremy merged 3 commits intomainfrom
timesheet-api
Feb 5, 2026
Merged

Add timesheet entry CRUD commands and clock shortcut#129
jeremy merged 3 commits intomainfrom
timesheet-api

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Feb 5, 2026

Summary

  • Update SDK to main after Add timesheet entry API operations (Create, Update, Get, Trash) basecamp-sdk#76 merged (timesheet entry API operations)
  • Add bcq timesheet entry show|create|update|trash subcommands for full timesheet CRUD
  • Add bcq clock <hours> --on <recording> shortcut for quick time logging (defaults to today)
  • Fix lineup marker field renames from SDK update (TitleName, StartsOn/EndsOnDate)

New commands

Command Description
bcq timesheet entry show <id|url> View a single timesheet entry
bcq timesheet entry create --recording <id|url> --hours <h> --date <d> Log time against a recording
bcq timesheet entry update <id|url> --hours/--date/--description/--person Update an entry
bcq timesheet entry trash <id|url> Move an entry to the trash
bcq clock <hours> --on <id|url> Shortcut — log time, date defaults to today

Dates accept natural language (today, yesterday, monday, etc.) via dateparse. Hours accept decimal (1.5) or time format (1:30). All commands support Basecamp URL arguments.

Test plan

  • make passes (vet, lint, unit tests, integration tests)
  • TestCatalogMatchesRegisteredCommands passes (clock shortcut registered and cataloged)
  • E2E: bcq timesheet entry create --recording <id> --hours 1.5 --date today --project <p>
  • E2E: bcq clock 1.5 --on <id> --project <p>

Picks up Get, Create, Update, and Trash timesheet entry methods plus
the Marker type renames (Title→Name, StartsOn/EndsOn→Date). Adapts
lineup.go to the new field names.
New subcommands under `bcq timesheet entry`:
- show: view a single timesheet entry
- create: log time against a recording (--recording, --hours, --date)
- update: modify hours, date, description, or person
- trash: move an entry to the trash

New shortcut `bcq clock <hours> --on <recording>` for quick time
logging with --date defaulting to today.

Dates accept natural language via dateparse (today, yesterday, monday,
etc.). Hours accept decimal (1.5) or time format (1:30). All commands
support URL arguments for entry/recording IDs.
Copilot AI review requested due to automatic review settings February 5, 2026 08:07
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 56f6e72204

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/commands/timesheet.go Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive CRUD operations for timesheet entries, a convenient clock shortcut command for quick time logging, and updates the SDK to incorporate field renames for lineup markers.

Changes:

  • Updated SDK dependency to incorporate timesheet entry API operations and lineup marker field renames (TitleName, StartsOn/EndsOnDate)
  • Added full timesheet entry management: bcq timesheet entry show|create|update|trash subcommands
  • Added bcq clock <hours> --on <recording> shortcut command that defaults date to today for streamlined time logging
  • Updated lineup commands to use renamed SDK fields and registered the new clock command in the command catalog

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
go.mod Updated SDK dependency to version with timesheet entry operations and lineup marker field renames
go.sum Updated checksums for new SDK version
internal/commands/timesheet.go Added comprehensive timesheet entry CRUD commands (show, create, update, trash) and clock shortcut command with natural language date parsing
internal/commands/lineup.go Updated to use renamed SDK fields for lineup markers (Name, Date instead of Title, StartsOn, EndsOn)
internal/commands/commands.go Updated command catalog to include new timesheet entry actions and clock shortcut
internal/cli/root.go Registered NewClockCmd in root command
internal/commands/commands_test.go Added NewClockCmd to test command registration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/commands/timesheet.go
Comment thread internal/commands/lineup.go
Address PR review feedback:
- Validate entry and recording IDs with strconv.ParseInt instead of
  silently passing 0 to the API, returning "Invalid entry ID" or
  "Invalid recording ID" usage errors on non-numeric input
- Extract runTimesheetCreate helper to eliminate ~80 lines of
  duplication between newTimesheetEntryCreateCmd and NewClockCmd
@jeremy jeremy merged commit c1c3731 into main Feb 5, 2026
10 checks passed
@jeremy jeremy deleted the timesheet-api branch February 5, 2026 08:22
jeremy added a commit that referenced this pull request Feb 19, 2026
* Update SDK to main after timesheet-api merge (basecamp/basecamp-sdk#76)

Picks up Get, Create, Update, and Trash timesheet entry methods plus
the Marker type renames (Title→Name, StartsOn/EndsOn→Date). Adapts
lineup.go to the new field names.

* Add timesheet entry CRUD commands and clock shortcut

New subcommands under `bcq timesheet entry`:
- show: view a single timesheet entry
- create: log time against a recording (--recording, --hours, --date)
- update: modify hours, date, description, or person
- trash: move an entry to the trash

New shortcut `bcq clock <hours> --on <recording>` for quick time
logging with --date defaulting to today.

Dates accept natural language via dateparse (today, yesterday, monday,
etc.). Hours accept decimal (1.5) or time format (1:30). All commands
support URL arguments for entry/recording IDs.

* Validate entry/recording IDs and extract shared create helper

Address PR review feedback:
- Validate entry and recording IDs with strconv.ParseInt instead of
  silently passing 0 to the API, returning "Invalid entry ID" or
  "Invalid recording ID" usage errors on non-numeric input
- Extract runTimesheetCreate helper to eliminate ~80 lines of
  duplication between newTimesheetEntryCreateCmd and NewClockCmd
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.

2 participants