diff --git a/__tests__/components/backlog/integration.test.tsx b/__tests__/components/backlog/integration.test.tsx index 703d229..7875c50 100644 --- a/__tests__/components/backlog/integration.test.tsx +++ b/__tests__/components/backlog/integration.test.tsx @@ -71,7 +71,7 @@ const STORIES: BacklogStory[] = [ { id: STORY_ID, code: 'ST-1', title: 'Eerste story', description: null, acceptance_criteria: null, priority: 2, sort_order: 1, status: 'OPEN', pbi_id: PBI_ID, sprint_id: null, created_at: new Date() }, ] const TASKS: BacklogTask[] = [ - { id: 'task-1', title: 'Eerste taak', description: null, priority: 2, status: 'TO_DO', sort_order: 1, story_id: STORY_ID, created_at: new Date() }, + { id: 'task-1', code: null, title: 'Eerste taak', description: null, priority: 2, status: 'TO_DO', sort_order: 1, story_id: STORY_ID, created_at: new Date() }, ] function resetStores() { diff --git a/__tests__/components/backlog/task-panel.test.tsx b/__tests__/components/backlog/task-panel.test.tsx index 69b844c..4067c6d 100644 --- a/__tests__/components/backlog/task-panel.test.tsx +++ b/__tests__/components/backlog/task-panel.test.tsx @@ -71,8 +71,8 @@ const STORY_ID = 'story-1' const CLOSE_PATH = `/products/${PRODUCT_ID}` const TASKS = [ - { id: 'task-1', title: 'Eerste taak', description: null, priority: 2, status: 'TO_DO', sort_order: 1, story_id: STORY_ID, created_at: new Date() }, - { id: 'task-2', title: 'Tweede taak', description: null, priority: 3, status: 'IN_PROGRESS', sort_order: 2, story_id: STORY_ID, created_at: new Date() }, + { id: 'task-1', code: null, title: 'Eerste taak', description: null, priority: 2, status: 'TO_DO', sort_order: 1, story_id: STORY_ID, created_at: new Date() }, + { id: 'task-2', code: null, title: 'Tweede taak', description: null, priority: 3, status: 'IN_PROGRESS', sort_order: 2, story_id: STORY_ID, created_at: new Date() }, ] function renderPanel(isDemo = false) { diff --git a/__tests__/stores/product-workspace/store.test.ts b/__tests__/stores/product-workspace/store.test.ts index f2db43b..ff86cfc 100644 --- a/__tests__/stores/product-workspace/store.test.ts +++ b/__tests__/stores/product-workspace/store.test.ts @@ -106,6 +106,7 @@ function makeStory(overrides: Partial & { id: string; pbi_id: stri function makeTask(overrides: Partial & { id: string; story_id: string }): BacklogTask { return { id: overrides.id, + code: overrides.code ?? null, title: overrides.title ?? `Task ${overrides.id}`, description: overrides.description ?? null, priority: overrides.priority ?? 2, diff --git a/app/(app)/products/[id]/page.tsx b/app/(app)/products/[id]/page.tsx index 1b645bf..d63fbec 100644 --- a/app/(app)/products/[id]/page.tsx +++ b/app/(app)/products/[id]/page.tsx @@ -75,6 +75,7 @@ export default async function ProductBacklogPage({ params, searchParams }: Props where: { story: { pbi: { product_id: id } } }, select: { id: true, + code: true, title: true, description: true, priority: true, diff --git a/app/(mobile)/m/products/[id]/page.tsx b/app/(mobile)/m/products/[id]/page.tsx index 479db27..25331b6 100644 --- a/app/(mobile)/m/products/[id]/page.tsx +++ b/app/(mobile)/m/products/[id]/page.tsx @@ -61,6 +61,7 @@ export default async function MobileProductBacklogPage({ params, searchParams }: where: { story: { pbi: { product_id: id } } }, select: { id: true, + code: true, title: true, description: true, priority: true, diff --git a/app/api/products/[id]/backlog/route.ts b/app/api/products/[id]/backlog/route.ts index 14ef956..e187edb 100644 --- a/app/api/products/[id]/backlog/route.ts +++ b/app/api/products/[id]/backlog/route.ts @@ -66,6 +66,7 @@ export async function GET( orderBy: [{ sort_order: 'asc' }, { created_at: 'asc' }], select: { id: true, + code: true, title: true, description: true, priority: true, diff --git a/app/api/stories/[id]/tasks/route.ts b/app/api/stories/[id]/tasks/route.ts index 9e437a4..2584ff7 100644 --- a/app/api/stories/[id]/tasks/route.ts +++ b/app/api/stories/[id]/tasks/route.ts @@ -33,6 +33,7 @@ export async function GET( orderBy: [{ sort_order: 'asc' }, { created_at: 'asc' }], select: { id: true, + code: true, title: true, description: true, priority: true, diff --git a/stores/product-workspace/store.ts b/stores/product-workspace/store.ts index 26693e6..ecec31f 100644 --- a/stores/product-workspace/store.ts +++ b/stores/product-workspace/store.ts @@ -1039,6 +1039,7 @@ function coerceTaskPayload(id: string, p: Record): BacklogTask const title = p.title ?? p.task_title ?? '' return { id, + code: (p.code as string | null | undefined) ?? null, title: String(title), description: (p.description as string | null | undefined) ?? null, priority: Number(p.priority ?? 4), diff --git a/stores/product-workspace/types.ts b/stores/product-workspace/types.ts index 1407a95..49727ab 100644 --- a/stores/product-workspace/types.ts +++ b/stores/product-workspace/types.ts @@ -27,6 +27,7 @@ export interface BacklogStory { export interface BacklogTask { id: string + code: string | null title: string description: string | null priority: number