feat(codes): server actions + seed/scripts gebruiken code overal
- actions/tasks.ts: saveTask + createTaskAction (legacy form) gebruiken
createWithCodeRetry + generateNextTaskCode; persisten product_id
denormalisatie. P2002 op user-supplied code wordt 422 met fieldError
- actions/pbis.ts + stories.ts: insert-helpers nemen verplichte string;
update laat code-veld weg uit data wanneer null (kan niet meer leeg
worden gemaakt nu DB NOT NULL is)
- actions/todos.ts: promoteTodoToPbi/Story genereren expliciet een code
voor het transactiestart (kan niet binnen $transaction array retryen)
- prisma/seed.ts: per-product task counter geeft elke task een T-N code
- scripts/insert-milestone.ts: createMany berekent maxN voor product
en assigneert T-{maxN+i+1} per nieuwe task
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
829122d437
commit
7c82a736f5
6 changed files with 82 additions and 32 deletions
|
|
@ -68,7 +68,7 @@ export async function createPbiAction(_prevState: unknown, formData: FormData) {
|
|||
|
||||
const status = parsed.data.status ? pbiStatusFromApi(parsed.data.status) ?? undefined : undefined
|
||||
|
||||
const insert = (code: string | null) =>
|
||||
const insert = (code: string) =>
|
||||
prisma.pbi.create({
|
||||
data: {
|
||||
product_id: parsed.data.productId,
|
||||
|
|
@ -156,7 +156,7 @@ export async function updatePbiAction(_prevState: unknown, formData: FormData) {
|
|||
await prisma.pbi.update({
|
||||
where: { id: parsed.data.id },
|
||||
data: {
|
||||
code,
|
||||
...(code ? { code } : {}),
|
||||
title: parsed.data.title,
|
||||
description: parsed.data.description ?? null,
|
||||
priority: parsed.data.priority,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue