Skip to content

feat(applications): retrieveForOrganization — one application, hiring side - #19

Merged
thinkclay merged 1 commit into
mainfrom
feat/employer-application-get
Aug 11, 2026
Merged

thinkclay merged 1 commit into
mainfrom
feat/employer-application-get

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

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 shape listForOrganization() 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.ts that were tripping biome's noNonNullAssertion. 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 lint clean (the one remaining info is pre-existing in http-client.test.ts), typecheck and build clean.

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.

… 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant