import { Router } from 'express'; import { requireAuth, AuthRequest } from '../auth/middleware'; import { resumeQueue } from '../../server'; const router = Router(); router.use(requireAuth); router.get('/', async (req: AuthRequest, res) => { const { search, cursor, limit = '20' } = req.query; // TODO: semantic + keyword search using pgvector res.json({ data: { candidates: [], meta: { next_cursor: null, has_more: false } } }); }); router.post('/:id/resume', async (req: AuthRequest, res) => { const { id } = req.params; const { s3Url, fileName } = req.body; await resumeQueue.add('parse', { candidateId: id, s3Url, fileName, orgId: req.user!.orgId, }, { attempts: 3, backoff: { type: 'exponential', delay: 5000 }, }); res.json({ data: { message: 'Resume queued for parsing', candidateId: id } }); }); router.get('/:id', async (req: AuthRequest, res) => { // TODO: fetch candidate with parsed_data res.json({ data: { id: req.params.id, name: 'Candidate', parsed_data: null } }); }); export { router as candidatesRouter };