feat(ST-208/ST-306): add description to PBI and story create actions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
336edad5ce
commit
ce6ba59540
2 changed files with 9 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ async function getSession() {
|
||||||
const createPbiSchema = z.object({
|
const createPbiSchema = z.object({
|
||||||
productId: z.string(),
|
productId: z.string(),
|
||||||
title: z.string().min(1, 'Titel is verplicht').max(200),
|
title: z.string().min(1, 'Titel is verplicht').max(200),
|
||||||
|
description: z.string().max(2000).optional(),
|
||||||
priority: z.coerce.number().int().min(1).max(4),
|
priority: z.coerce.number().int().min(1).max(4),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -33,6 +34,7 @@ export async function createPbiAction(_prevState: unknown, formData: FormData) {
|
||||||
const parsed = createPbiSchema.safeParse({
|
const parsed = createPbiSchema.safeParse({
|
||||||
productId: formData.get('productId'),
|
productId: formData.get('productId'),
|
||||||
title: formData.get('title'),
|
title: formData.get('title'),
|
||||||
|
description: formData.get('description') || undefined,
|
||||||
priority: formData.get('priority'),
|
priority: formData.get('priority'),
|
||||||
})
|
})
|
||||||
if (!parsed.success) return { error: parsed.error.flatten().fieldErrors }
|
if (!parsed.success) return { error: parsed.error.flatten().fieldErrors }
|
||||||
|
|
@ -50,6 +52,7 @@ export async function createPbiAction(_prevState: unknown, formData: FormData) {
|
||||||
data: {
|
data: {
|
||||||
product_id: parsed.data.productId,
|
product_id: parsed.data.productId,
|
||||||
title: parsed.data.title,
|
title: parsed.data.title,
|
||||||
|
description: parsed.data.description ?? null,
|
||||||
priority: parsed.data.priority,
|
priority: parsed.data.priority,
|
||||||
sort_order,
|
sort_order,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,8 @@ const createStorySchema = z.object({
|
||||||
pbiId: z.string(),
|
pbiId: z.string(),
|
||||||
productId: z.string(),
|
productId: z.string(),
|
||||||
title: z.string().min(1, 'Titel is verplicht').max(200),
|
title: z.string().min(1, 'Titel is verplicht').max(200),
|
||||||
|
description: z.string().max(2000).optional(),
|
||||||
|
acceptance_criteria: z.string().max(2000).optional(),
|
||||||
priority: z.coerce.number().int().min(1).max(4),
|
priority: z.coerce.number().int().min(1).max(4),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -47,6 +49,8 @@ export async function createStoryAction(_prevState: unknown, formData: FormData)
|
||||||
pbiId: formData.get('pbiId'),
|
pbiId: formData.get('pbiId'),
|
||||||
productId: formData.get('productId'),
|
productId: formData.get('productId'),
|
||||||
title: formData.get('title'),
|
title: formData.get('title'),
|
||||||
|
description: formData.get('description') || undefined,
|
||||||
|
acceptance_criteria: formData.get('acceptance_criteria') || undefined,
|
||||||
priority: formData.get('priority') ?? 2,
|
priority: formData.get('priority') ?? 2,
|
||||||
})
|
})
|
||||||
if (!parsed.success) return { error: parsed.error.flatten().fieldErrors }
|
if (!parsed.success) return { error: parsed.error.flatten().fieldErrors }
|
||||||
|
|
@ -67,6 +71,8 @@ export async function createStoryAction(_prevState: unknown, formData: FormData)
|
||||||
pbi_id: parsed.data.pbiId,
|
pbi_id: parsed.data.pbiId,
|
||||||
product_id: pbi.product_id,
|
product_id: pbi.product_id,
|
||||||
title: parsed.data.title,
|
title: parsed.data.title,
|
||||||
|
description: parsed.data.description ?? null,
|
||||||
|
acceptance_criteria: parsed.data.acceptance_criteria ?? null,
|
||||||
priority: parsed.data.priority,
|
priority: parsed.data.priority,
|
||||||
sort_order,
|
sort_order,
|
||||||
status: 'OPEN',
|
status: 'OPEN',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue