dow-prod-tracker/prisma
Leivur Djurhuus ec420f79d6 Fix dynamic pipeline stages: form submissions, unique constraint, and stage name resolution
Three related bugs fixed:

1. Form save buttons silently failing — valueAsNumber on empty number inputs
   produced NaN, which Zod rejected without visible errors on hidden tabs.
   Replaced with setValueAs that converts empty strings to undefined.

2. Unique constraint violation on deliverable stage creation — dynamic pipeline
   stages without matching global template slugs all fell back to
   globalTemplates[0], creating duplicate (deliverableId, templateId) pairs.
   Changed constraint from @@unique([deliverableId, templateId]) to
   @@unique([deliverableId, stageDefinitionId]).

3. Stage names showing wrong template — all UI components read
   stage.template.name exclusively, ignoring stageDefinition from the dynamic
   pipeline system. Updated 13 components, 6 services, and all relevant Prisma
   queries to prefer stageDefinition over template for display.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 12:19:00 -05:00
..
migrations feat: implement stage date override and scheduling features 2026-03-12 23:13:29 -05:00
schema.prisma Fix dynamic pipeline stages: form submissions, unique constraint, and stage name resolution 2026-03-18 12:19:00 -05:00
seed-tracker-data.ts feat: enhance UI components and add assignment feature to deliverables 2026-03-02 13:46:55 -06:00
seed.ts feat: add pipeline stage resolver and organization access control 2026-03-14 22:43:43 -05:00