Files
evig/scripts
GandClaude Opus 4.8 5bfa69a0e6 fix: profile save validation (null fields) + timecard submit (DB constraints) + submit UX (#197)
Three user-reported issues:

1. **Profile "Validierungsfehler" on save.** GET /api/user/profile returns `null`
   for empty columns, but UpdateProfileSchema only accepted `string|undefined`, so
   loading a sparse profile and clicking Save failed validation on ~18 null fields.
   Schema fields are now `.nullish()` (null = empty) — the API accepts what it returns.

2. **Timecards with leave never submitted / never reached approvers (migration 107).**
   The timecard_entries CHECK constraints (migration 067) predated the config's Swiss
   absence categories (ferien/krank/unfall/feiertag/militaer/unbezahlt) and 0-minute
   unpaid markers, so ANY card containing a leave entry failed to INSERT → submit
   rolled back → status never became 'submitted' → the approvals queue was always
   empty, even for a superadmin. Migration realigns the constraints with the config
   SSOT (category list + duration_minutes >= 0). Must reach the prod Hetzner DB.

3. **Submit far from fill controls.** Save/Einreichen lived only in the top header
   while fill-from-plan + leave buttons are mid-page. Added a sticky bottom action
   bar so submit is always one tap away after filling.

typecheck clean.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 18:28:17 +02:00
..