feat(ideas): secondary_products meeladen in IdeaDto en alle queries

Voegt IdeaProduct schema toe (dependency van story-qtkvz6ly), breidt
IdeaWithProduct type en IdeaDto interface uit met secondary_products array,
en laadt de relatie mee in findMany/findFirst in page.tsx en REST GET.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scrum4Me Agent 2026-05-06 02:20:34 +02:00
parent d5333eb7d8
commit 4a929b1962
5 changed files with 32 additions and 6 deletions

View file

@ -9,6 +9,7 @@ import type { Idea, IdeaStatus, Product } from '@prisma/client'
type IdeaWithProduct = Idea & {
product: Pick<Product, 'id' | 'name' | 'repo_url'> | null
pbi?: { id: string; code: string; title: string } | null
secondary_products?: { id: string; product_id: string; product: { id: string; name: string } }[]
}
export interface IdeaDto {
@ -21,6 +22,7 @@ export interface IdeaDto {
product: { id: string; name: string; repo_url: string | null } | null
pbi_id: string | null
pbi?: { id: string; code: string; title: string } | null
secondary_products: { id: string; product_id: string; product: { id: string; name: string } }[]
archived: boolean
has_grill_md: boolean
has_plan_md: boolean
@ -39,6 +41,7 @@ export function ideaToDto(idea: IdeaWithProduct & { status: IdeaStatus }): IdeaD
product: idea.product,
pbi_id: idea.pbi_id,
pbi: idea.pbi ?? null,
secondary_products: idea.secondary_products ?? [],
archived: idea.archived,
// Geen md-content in lijst-payloads (kan groot zijn) — enkel een vlag.
has_grill_md: idea.grill_md !== null,