feat(story-dialog): conform aan dialog-pattern + AlertDialog delete
Story 4 van PBI "Alle dialogen conform docs/patterns/dialog.md". - lib/schemas/story.ts — gedeeld zod-schema - actions/stories.ts — code+fieldErrors voor 422; code: 403 voor auth/demo - StoryDialog adopt useDirtyCloseGuard, useDialogSubmitShortcut, entityDialog* layout-classes - Inline delete-confirm vervangen door AlertDialog (§10.4) - docs/specs/dialogs/story.md — gaps weggewerkt; alleen bewuste afwijkingen blijven (header met badges, geen char-counter) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
97dc4ee553
commit
01e77fc560
5 changed files with 240 additions and 167 deletions
26
lib/schemas/story.ts
Normal file
26
lib/schemas/story.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { z } from 'zod'
|
||||
import { MAX_CODE_LENGTH } from '@/lib/code'
|
||||
|
||||
const codeField = z.string().max(MAX_CODE_LENGTH).optional()
|
||||
|
||||
export const createStorySchema = z.object({
|
||||
pbiId: z.string(),
|
||||
productId: z.string(),
|
||||
code: codeField,
|
||||
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),
|
||||
})
|
||||
|
||||
export const updateStorySchema = z.object({
|
||||
id: z.string(),
|
||||
code: codeField,
|
||||
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),
|
||||
})
|
||||
|
||||
export type CreateStoryInput = z.infer<typeof createStorySchema>
|
||||
export type UpdateStoryInput = z.infer<typeof updateStorySchema>
|
||||
Loading…
Add table
Add a link
Reference in a new issue