Skip to content

feat(ats): calendar connections and availability windows — the half of #540 that is an OAuth integration #563

Open

Description

@thinkclay

Split out of #540. Slots and self-scheduling links now read and write real data (#562); the other two panels on /office/ats/scheduling do not, and they are a different kind of work.

#540's acceptance said "all four panels read from the database". Two do. This issue carries the other two, so that is stated plainly rather than left implied by a closed issue.

What is still sample data

packages/scf-core/features/office/scheduling/CalendarSchedulingScreen.tsx still holds MOCK_CONNECTIONS and MOCK_AVAILABILITY, gated behind CALENDAR_USES_SAMPLE_DATA. The notice now sits on the Calendar Connections tab rather than the whole screen, and the "Connect Google", "Connect Outlook" and "Add Availability" buttons stay disabled so no input is silently discarded.

Why it was not done with the rest

Calendar connections are not a CRUD endpoint. core.calendar_connections stores access_token_encrypted, refresh_token_encrypted and provider_account_id. Filling that table means an OAuth flow with Google and Microsoft: consent screens, redirect URIs, token refresh, encryption at rest, and revocation. None of that exists.

Availability windows have no consumer. core.interview_availability can be read and written today, but a window only means something if it generates bookable slots — and there is no generation step. Wiring the panel would produce rows that change nothing, which is a more convincing kind of fake than the mock it replaced.

Work

  1. OAuth apps for Google Calendar and Microsoft Graph, with redirect handling in the app.
  2. An encryption story for the stored tokens — the columns are named *_encrypted but nothing encrypts them yet.
  3. Token refresh and revocation, including what happens to proposed slots when a connection is revoked.
  4. CRUD for core.interview_availability.
  5. Slot generation from availability windows — the piece that makes 4 worth doing.
  6. Free/busy sync, so a proposed slot cannot collide with an existing calendar event.

Acceptance

  • Connecting Google or Outlook stores a working connection and survives a token refresh.
  • Availability windows persist and generate bookable slots.
  • CALENDAR_USES_SAMPLE_DATA and both MOCK_ constants are deleted from CalendarSchedulingScreen.tsx, along with the notice.

Not agent-ready: steps 1–3 need OAuth client registration and a decision on key management, neither of which is self-contained.

Related: #540 (closed — slots and links), #561 (the scheduling API), #562 (the client wiring).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions