Skip to content

Feat: Add typed SDK support for the grouped time report#99

Merged
tw-garymeehan merged 1 commit into
mainfrom
gary/time-report-sdk
Jul 13, 2026
Merged

Feat: Add typed SDK support for the grouped time report#99
tw-garymeehan merged 1 commit into
mainfrom
gary/time-report-sdk

Conversation

@tw-garymeehan

@tw-garymeehan tw-garymeehan commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What

Adds typed SDK support for the grouped time report — GET /projects/api/v3/time/report/{type}.json — modelled generically (one request type covering all six group dimensions) rather than a user-only narrowing.

  • TimeReportType enum selects the grouping dimension: user, project, company, tasklist, task, team. Exactly one response slice is populated per call.
  • Request surface: required startDate/endDate (date-only), comma-joined ID-list filters (projectIds, userIds, taskIds, tasklistIds, teamIds, companyIds, timelogTagIds), includeArchivedProjects, reportType, sideload include, and pagination.
  • Time columns (loggedTime, billableTime, nonBillableTime, billedTime, estimatedTime) are int64 minutes.
  • Typed Included maps for the users and projects sideloads.
  • Sparse fieldsets wired per repo conventions; generated output committed.

The workload endpoint was the structural template (date-windowed, paginated, sideloaded).

Acceptance criteria

  • Generic request/response with the full six-value Type enum; constructor requires the date window
  • skipCounts=true hard-coded; pagination meta exposes hasMore only; standard Iterate() works
  • Typed Included maps for users and projects
  • Sparse fieldsets wired; go generate output committed; CI green
  • Example tests using the in-process mock HTTP server (run without env vars), covering rows + included users decoding
  • Env-gated integration test that skips without a live server/token
  • Totals endpoint not modelled

Verification

go build, go vet, gofmt -l, and go test ./projects/ -run TimeReport all clean; go generate ./... produces zero drift.

🤖 Generated with Claude Code

Model GET /projects/api/v3/time/report/{type} generically: a single request
type with a six-value Type enum (user, project, company, tasklist, task, team)
selecting the grouping dimension, plus the response's per-type row slices with
typed Included maps for the users and projects sideloads.

- Constructor requires the date window; skipCounts hard-coded; hasMore-only
  pagination meta with standard Iterate().
- Sparse fieldsets wired per repo conventions (generated output committed).
- Example test (in-process mock, no env vars) covering rows + included users,
  plus an env-gated integration test.
- Totals endpoint deliberately not modelled.

Task: https://digitalcrew.teamwork.com/app/tasks/26469936

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tw-garymeehan
tw-garymeehan requested a review from a team as a code owner July 10, 2026 15:33

@rafaeljusto rafaeljusto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚀

@tw-garymeehan
tw-garymeehan merged commit 2ad45e6 into main Jul 13, 2026
3 checks passed
@tw-garymeehan
tw-garymeehan deleted the gary/time-report-sdk branch July 13, 2026 11:20
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