Skip to content

Conversation

@emrysal
Copy link
Contributor

@emrysal emrysal commented Jan 8, 2026

Summary by cubic

Refactored getUsersAvailability to validate params upfront and rely on preloaded user data, reducing coupling and clarifying types. This also standardizes travel schedules, OOO notes, and busy slot source handling.

  • Refactors
    • Introduced GetUserAvailabilityParams (Dayjs dateFrom/dateTo) and moved parsing/validation to getUsersAvailability.
    • Removed internal getUser; callers must supply the user (via initialData or provided users array).
    • Expanded user shape with credentials, selected calendars, and travelSchedules; updated types accordingly.
    • Built travelSchedules only for default schedules and passed them to buildDateRanges.
    • Simplified OOO mapping (hide notes when not public, safer optional fields) and used params.withSource consistently for busy slot sources.
    • Updated API and TRPC handlers to validate date ranges and pass Dayjs dates to the service.

Written for commit 7f99736. Summary will update on new commits.

@vercel
Copy link

vercel bot commented Jan 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

4 Skipped Deployments
Project Deployment Review Updated (UTC)
api-v2 Ignored Ignored Preview Jan 8, 2026 3:58pm
cal Ignored Ignored Jan 8, 2026 3:58pm
cal-companion Ignored Ignored Preview Jan 8, 2026 3:58pm
cal-eu Ignored Ignored Jan 8, 2026 3:58pm

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

E2E results are ready!

@emrysal emrysal marked this pull request as ready for review January 8, 2026 14:41
@emrysal emrysal requested a review from a team as a code owner January 8, 2026 14:41
@graphite-app graphite-app bot added foundation core area: core, team members only labels Jan 8, 2026
@emrysal emrysal enabled auto-merge (squash) January 8, 2026 14:42
Copy link
Contributor

@volnei volnei left a comment

Choose a reason for hiding this comment

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

LGTM ❤️

@emrysal emrysal merged commit 23ecd1c into main Jan 8, 2026
50 of 51 checks passed
@emrysal emrysal deleted the refactor/move-parsing-in-get-users-availability branch January 8, 2026 14:45
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 6 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants