Repository navigation
feat(applications): retrieveForOrganization — one application, hiring side - #19
Merged
Merged
Conversation
… side Scaffald/SaaS#537 adds a per-application detail route. Candidate detail existed only as a modal, so it could not be linked, shared, or reached with the back button. `retrieve()` already serves employers, but it returns the applicant's projection: job and organisation embedded, no candidate. `retrieveForOrganization()` returns the same row shape `listForOrganization()` does — candidate identity and stage history included — so a detail view and a kanban card are built from one transform rather than two that drift apart. 404 rather than 403 for an application outside the caller's organisations, so the endpoint cannot be used to probe which ids exist. Also drops three non-null assertions from compliance.test.ts that were tripping biome's noNonNullAssertion — mine, from the previous PR. Full suite 783 passed.
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.
Pairs with Scaffald/SaaS#537, which adds a per-application detail route. Candidate detail exists only as a modal today, so it cannot be linked, shared, or reached with the browser back button.
Why not just use
retrieve()retrieve()already serves employers —GET /v1/applications/{id}falls back to organisation access. But it returns the applicant's projection: job and organisation embedded, and no candidate.retrieveForOrganization()returns the same row shapelistForOrganization()does, candidate identity and stage history included. That matters because the office UI transforms API rows into its domain type: with one shape, a detail view and a kanban card are built from one transform. With two, they drift, and the drift shows up as a field that renders on the board and is blank on the detail page.404, not 403
An application outside the caller's organisations returns 404. A 403 would confirm the id exists, which turns the endpoint into a probe for valid application ids.
Also in this PR
Drops three non-null assertions from
compliance.test.tsthat were tripping biome'snoNonNullAssertion. Mine, from #18 — they were warnings rather than errors so the PR merged, but they should not have shipped.Verification
2 new tests; full suite 783 passed.
pnpm lintclean (the one remaininginfois pre-existing inhttp-client.test.ts),typecheckandbuildclean.The route was driven against a live local database first: it returns the list row shape exactly, and a cross-organisation read 404s while an unknown id 404s and a non-uuid 400s.