Repository navigation
feat(scheduling): employer-side slot and link methods - #17
Merged
Merged
Conversation
The scheduling resource had only the candidate's two token-addressed methods (getLink, bookSlot). There was no employer half at all, which is why the office scheduling screen rendered MOCK_ constants — there was nothing to call. Adds listSlots / createSlot / listLinks / createLink against the /v1/employer/scheduling routes (Scaffald/SaaS#561). Two things worth noting: - `application_id` is optional on the list calls. The office scheduling screen is organisation-wide — "Upcoming Interviews" spans every open application — so omitting it lists across every organisation the caller can act for. Appending `application_id=undefined` would 400 against the uuid schema, so the param is omitted rather than stringified; there is a test for exactly that. - `EmployerInterviewSlot` / `EmployerSchedulingLink` are deliberately separate from the existing `SchedulingSlot` / `SchedulingLink`. Those are the candidate's redacted view behind a link token; these carry the application, organisation and lifecycle status the pipeline needs. Same concept, different projections — collapsing them would leak employer fields into the candidate type. `createLink` takes no token: it is generated server-side, and a client-chosen token would be a guessable-URL vulnerability. 6 tests, mutation-checked — reverting the envelope unwrap or the optional param turns them red.
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.
The employer half of interview scheduling. Pairs with Scaffald/SaaS#561, which added the
/v1/employer/schedulingroutes.Why
Schedulinghad two methods, both the candidate's:getLink(token)andbookSlot(token, slotId). Nothing could create a slot or mint a link. That is why the office scheduling screen rendersMOCK_SLOTS/MOCK_LINKS— there was no employer API to call, so the screen was never wired (Scaffald/SaaS#525, #540).What
listSlots(params?)GET /v1/employer/scheduling/slotscreateSlot(params)POST /v1/employer/scheduling/slotslistLinks(params?)GET /v1/employer/scheduling/linkscreateLink(params)POST /v1/employer/scheduling/linksTwo decisions
application_idis optional on the list calls. The office screen is organisation-wide, so omitting it lists across every organisation the caller can act for. The param is omitted rather than stringified —application_id=undefinedwould 400 against the uuid schema. Tested directly.New types rather than reusing the existing ones.
SchedulingSlot/SchedulingLinkare the candidate's redacted view behind a link token.EmployerInterviewSlot/EmployerSchedulingLinkcarryapplication_id,organization_id,status,proposed_by. Same concept, different projections; collapsing them would leak employer fields into the candidate type.createLinktakes notoken— it is generated server-side (encode(gen_random_bytes(32), 'hex')). A client-chosen token would be a guessable-URL vulnerability, so the params type cannot express one.Verification
{data}envelope instead of unwrapping it, and always appendingapplication_id, each turn a test red.pnpm lintclean (the one remaininginfois pre-existing inhttp-client.test.ts),pnpm typecheckclean,pnpm buildclean.