Scrum4Me/__tests__/api
Madhura68 0e2808ac88 realtime: route idea-jobs + idea-questions to /notifications channel (M12 T-502)
Idea-jobs and idea-questions are user-private (M12 grill-keuze 8) — they
flow through /api/realtime/notifications, not /api/realtime/solo.

app/api/realtime/notifications/route.ts:
- Pre-fetch user's idea-ids → accessibleIdeaIds Set (avoids per-event DB lookup)
- New IdeaJobPayload type (claude_job_enqueued/_status with kind=IDEA_*)
- New QuestionPayload narrows: story_id and idea_id mutually exclusive (DB
  check-constraint enforces it)
- Routing: idea-jobs filtered on user_id; idea-questions on accessibleIdeaIds;
  story-questions on accessibleProductIds (existing path)

app/api/realtime/solo/route.ts:
- JobPayload extended with optional kind + idea_id
- shouldEmit filters out kind=IDEA_GRILL/IDEA_MAKE_PLAN — they don't belong
  on the product/sprint Solo Paneel

Tests: 539/539 green; notifications-stream test mock updated for idea.findMany.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 20:00:05 +02:00
..
backlog-realtime.test.ts feat(M14): 3-pane backlog — generic SplitPane, BacklogStore, SSE realtime, card-grid TaskPanel (#22) 2026-04-30 18:16:07 +02:00
cron-cleanup-agent-artifacts.test.ts M13: Veilige Claude-agent-workflow (Scrum4Me-side) (#26) 2026-05-01 13:42:18 +02:00
cron-expire-questions.test.ts M11: Claude vraagt, gebruiker antwoordt (ST-1101..ST-1108) (#13) 2026-04-29 11:38:23 +02:00
ideas.test.ts api: REST endpoints for ideas (M12 T-500) 2026-05-04 19:55:49 +02:00
next-story.test.ts Todo description, entity codes, REST API extensions and Claude Code hardening (ST-509/511/512/513) (#2) 2026-04-26 23:40:54 +02:00
notifications-stream.test.ts realtime: route idea-jobs + idea-questions to /notifications channel (M12 T-502) 2026-05-04 20:00:05 +02:00
pair-claim.test.ts M12 / ST-1110: Demo gebruiker read-only (#17) 2026-04-29 18:44:14 +02:00
pair-start.test.ts M12 / ST-1110: Demo gebruiker read-only (#17) 2026-04-29 18:44:14 +02:00
pair-stream.test.ts M10: Password-loze inlog via QR-pairing (ST-1001..ST-1008) (#12) 2026-04-28 00:01:04 +02:00
products.test.ts test(products): add unit tests for GET /api/products 2026-04-25 18:31:35 +02:00
reorder.test.ts Todo description, entity codes, REST API extensions and Claude Code hardening (ST-509/511/512/513) (#2) 2026-04-26 23:40:54 +02:00
security.test.ts M14: TaskDialog (create/edit) + story auto-promotion (#21) 2026-04-30 16:55:20 +02:00
sprint-tasks.test.ts Todo description, entity codes, REST API extensions and Claude Code hardening (ST-509/511/512/513) (#2) 2026-04-26 23:40:54 +02:00
story-log.test.ts Todo description, entity codes, REST API extensions and Claude Code hardening (ST-509/511/512/513) (#2) 2026-04-26 23:40:54 +02:00
tasks.test.ts M13: Veilige Claude-agent-workflow (Scrum4Me-side) (#26) 2026-05-01 13:42:18 +02:00
todos.test.ts Todo description, entity codes, REST API extensions and Claude Code hardening (ST-509/511/512/513) (#2) 2026-04-26 23:40:54 +02:00