hp-prod-tracker/src
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
..
app Fix dynamic pipeline stages: form submissions, unique constraint, and stage name resolution 2026-03-18 12:19:00 -05:00
components Fix dynamic pipeline stages: form submissions, unique constraint, and stage name resolution 2026-03-18 12:19:00 -05:00
hooks Fix dynamic pipeline stages: form submissions, unique constraint, and stage name resolution 2026-03-18 12:19:00 -05:00
lib Fix dynamic pipeline stages: form submissions, unique constraint, and stage name resolution 2026-03-18 12:19:00 -05:00
stores feat: add pipeline stage resolver and organization access control 2026-03-14 22:43:43 -05:00
types Add Auth.js v5 with Google + Microsoft Entra ID SSO 2026-02-28 21:07:38 -06:00
instrumentation.ts automation rules added to settings 2026-03-17 23:07:44 -05:00
middleware.ts Add dev bypass for authentication checks in middleware and session retrieval 2026-02-28 22:23:14 -06:00