Scrum4Me/app
Madhura68 eeed5d7506 feat(ST-1107): add Vercel cron expire-questions (+ M10 pairing cleanup)
POST /api/cron/expire-questions:
- Auth via Authorization: Bearer ${CRON_SECRET} (Vercel injecteert dit
  automatisch wanneer de env-var op de project-omgeving staat); 401 als secret
  niet matcht of niet is gezet (faal-veilig — geen open endpoint in dev)
- updateMany op claude_questions WHERE status='open' AND expires_at<now →
  'expired'
- Bonus: zelfde route ruimt M10 login_pairings op (status='pending' AND
  expires_at<now → 'cancelled'). Eén cron-job is goedkoper qua Vercel-budget
  en houdt cleanup-strategie centraal — opvolg-actie uit M10 dat geparkeerd was.

Config:
- vercel.json: crons-entry { path: '/api/cron/expire-questions', schedule: '0 */6 * * *' } (4x/dag)
- lib/env.ts: CRON_SECRET als optional in Zod-schema
- .env.example: documentatie + openssl rand-tip

Tests __tests__/api/cron-expire-questions.test.ts (4 cases):
- 401 zonder Authorization-header
- 401 met verkeerde secret
- 401 als CRON_SECRET niet is gezet (faal-veilig)
- 200 met juiste secret: response { expired_questions, expired_pairings, ran_at }
  + beide updateMany WHERE/data correct

Quality gates: lint 0 errors, tsc clean, vitest 151/151.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 01:51:48 +02:00
..
(app) feat(ST-1105): add NavBar bell + sheet + answer-modal + Zustand store + SSE hook 2026-04-28 01:25:07 +02:00
(auth) M10: Password-loze inlog via QR-pairing (ST-1001..ST-1008) (#12) 2026-04-28 00:01:04 +02:00
api feat(ST-1107): add Vercel cron expire-questions (+ M10 pairing cleanup) 2026-04-28 01:51:48 +02:00
debug-env chore(debug): add /debug-env page to verify Vercel env-var presence 2026-04-27 10:37:46 +02:00
styles chore: documentatie naar docs/, iconen bijgewerkt, theme.css verplaatst 2026-04-24 22:51:42 +02:00
apple-icon.png chore: documentatie naar docs/, iconen bijgewerkt, theme.css verplaatst 2026-04-24 22:51:42 +02:00
favicon.ico chore: documentatie naar docs/, iconen bijgewerkt, theme.css verplaatst 2026-04-24 22:51:42 +02:00
globals.css chore: documentatie naar docs/, iconen bijgewerkt, theme.css verplaatst 2026-04-24 22:51:42 +02:00
icon.png chore: documentatie naar docs/, iconen bijgewerkt, theme.css verplaatst 2026-04-24 22:51:42 +02:00
layout.tsx Add analytics and documentation updates 2026-04-25 15:11:51 +02:00
page.tsx feat(landing): highlight realtime updates and beta/desktop-first notice 2026-04-27 20:29:51 +02:00