// screenMATCH API client: every call targets the /api/screenmatch namespace over the ONE shared // scoring core, so a candidate qualified here shows the same numbers as in slateMATCH and missionMATCH. // It reuses the shared request helper (session cookie, CSRF, error handling); only the paths differ, so // this module could later be extracted with its client intact. import { request } from '../../lib/api' import type { CandidateListView, OpportunityFitView, RankedCandidateView, RequirementListView, ScreenView, } from '../../lib/types' const NS = '/screenmatch' export const screenApi = { requirements: () => request(`${NS}/requirements?limit=200`), requirement: (id: string) => request(`${NS}/requirements/${encodeURIComponent(id)}`), candidate: (id: string) => request(`${NS}/candidates/${encodeURIComponent(id)}`), // POST /screen is the full explainable qualification; the server persists it as the latest evaluation. screen: (candidate_id: string, requirement_id: string) => request(`${NS}/screen`, { method: 'POST', body: JSON.stringify({ candidate_id, requirement_id }), }), // Screen the whole pool against one requirement (the Candidate Screening Queue), ranked best first. rankCandidates: (requirementId: string) => request(`${NS}/requirements/${encodeURIComponent(requirementId)}/candidates`), opportunities: (candidateId: string) => request(`${NS}/candidates/${encodeURIComponent(candidateId)}/opportunities?limit=10`), }