Repository navigation
feat(office): wire interview scheduling to real data - #562
Merged
Merged
Conversation
Completes the client half of #540. The scheduling API landed in #561; this is the SDK and the screen. Backend change first: the two list routes now take `application_id` as *optional*. #561 required it, which turned out to be the wrong shape — the office scheduling screen is organisation-wide ("Upcoming Interviews" spans every open application, as the mock it replaces did), so with no application_id the routes list across every organisation the caller can act for. A caller with no organisations gets an empty list rather than a 403; a personal account should see an empty schedule, not an error. Screen: - Slots and links come from `/v1/employer/scheduling`. Loading, error and empty states, none of which existed. - Candidate names are resolved by joining the org's applications. The scheduling tables carry `application_id` and nothing about the person, so the name is looked up rather than denormalised. - Both modals write. "Propose Time" and "Create Link" previously opened forms whose submit button only closed the modal, so a user could believe they had scheduled an interview with a candidate who would never hear about it. They now validate and POST, with the errors surfaced. - Stat tiles derive from real slots. `no_show` is folded into completed — it exists in the database but not in this screen's union, and it is a finished interview, not an upcoming one. Two bugs found while wiring: - The link row rendered `schedule.scaffald.com/<token>`. That host does not exist; the real route is `/schedule/[token]`. A recruiter who copied that link sent a dead URL. Copy now yields a URL that resolves. - Link status read `is_active` alone. That flag is the employer's kill switch, not the clock, so an expired link showed as "Active". Expiry is now checked too. `USES_SAMPLE_DATA` narrowed to `CALENDAR_USES_SAMPLE_DATA` rather than disappearing, and the notice moved from the whole screen onto the Calendar Connections tab. Connections and availability are still placeholders, and not because a CRUD endpoint is missing: `core.calendar_connections` stores `access_token_encrypted` / `refresh_token_encrypted` / `provider_account_id` for Google and Outlook, which is an OAuth integration. Availability feeds slot generation, which does not exist either. Those two write paths stay disabled. So #540 is done; the calendar integration is not, and the label stays until it is. Verification: the existing test file said to replace its sample-data assertions with real ones rather than delete them, so it now has 12 tests covering the transform, both write paths, the URL and the expiry logic. Mutation-checked — dropping the no_show remap, judging links by is_active alone, or restoring the fabricated host each turns a test red. 248 office + utils tests pass. The routes were also driven from a real browser session: cross-origin preflight, auth and both list endpoints, returning only the caller's organisation.
Contributor
📊 Performance Benchmark Results |
This was referenced Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the client half of #540. The API landed in #561; this is the SDK (Scaffald/sdk#17, merged) and the screen.
One backend change first
The two list routes now take
application_idas optional. #561 required it, which was the wrong shape: the office scheduling screen is organisation-wide — "Upcoming Interviews" spans every open application, exactly as the mock it replaces did — so there was nothing useful for the screen to call. With noapplication_id, the routes list across every organisation the caller can act for. A caller with no organisations gets an empty list rather than a 403; a personal account should see an empty schedule, not an error.Verified against a live local database with two organisations: each admin's org-wide read returns only their own rows, and a cross-org probe by application id 404s.
The screen
/v1/employer/scheduling, with loading, error and empty states — none of which existed.application_idand nothing about the person, so the name is looked up rather than denormalised into the scheduling rows.no_showfolds into completed: it exists in the database but not in this screen's status union, and it is a finished interview, not an upcoming one.Two bugs found while wiring
The copied link was dead. The row rendered
schedule.scaffald.com/<token>. That host does not exist — the real route is/schedule/[token]. Any recruiter who used the Copy button sent a URL that resolves to nothing.Expired links showed as Active. Status read
is_activealone. That flag is the employer's kill switch, not the clock, so a link pastexpires_atstill read "Active" while the candidate could no longer redeem it. Expiry is now checked too.What is still sample data, and why
USES_SAMPLE_DATAnarrowed toCALENDAR_USES_SAMPLE_DATArather than disappearing, and the notice moved from the whole screen onto the Calendar Connections tab.Connections and availability are not blocked on a missing CRUD endpoint.
core.calendar_connectionsstoresaccess_token_encrypted/refresh_token_encrypted/provider_account_idfor Google and Outlook — that is an OAuth integration. Availability windows feed slot generation, which does not exist either. Those two write paths stay disabled rather than silently discarding input.So #540 is done and this closes it. The calendar integration is not, and the label stays until it is.
Verification
no_showremap, judging links byis_activealone, or restoring the fabricated host each turns a test red.scf-coresuite OOMs on this machine — that is the pre-existing vitest memory limit, not this change.interview_slots,scheduling_linksandinterview_bookingsare back to zero rows.Closes #540.