refactor: unify task input validation #343

Merged
barrettruth merged 1 commit from issue-320-task-input-normalization into main 2026-05-11 20:05:03 +00:00
Owner

Problem

Task create/update validation was split between API routes, server actions, and panel save helpers, so date, URL, recurrence, and status normalization could diverge.

Solution

  • Replace the duplicated create/update validators with shared parser exports in src/lib/validation.ts.
  • Route API writes, server actions, and task panel update payloads through that parser before persistence.
  • Define due dates, scheduled timestamps, all-day flags, recurrence mode, meeting URL, location, notes, status, and coordinates in one contract.

Verification

  • nix develop --command pnpm exec vitest run tests/lib/validation.test.ts tests/lib/task-panel-save.test.ts tests/api/tasks-route-validation.test.ts --reporter=verbose
  • nix develop --command just lint
  • nix develop --command just test

Closes #320

## Problem Task create/update validation was split between API routes, server actions, and panel save helpers, so date, URL, recurrence, and status normalization could diverge. ## Solution - Replace the duplicated create/update validators with shared parser exports in `src/lib/validation.ts`. - Route API writes, server actions, and task panel update payloads through that parser before persistence. - Define due dates, scheduled timestamps, all-day flags, recurrence mode, meeting URL, location, notes, status, and coordinates in one contract. ## Verification - `nix develop --command pnpm exec vitest run tests/lib/validation.test.ts tests/lib/task-panel-save.test.ts tests/api/tasks-route-validation.test.ts --reporter=verbose` - `nix develop --command just lint` - `nix develop --command just test` Closes #320
refactor: unify task input validation
All checks were successful
quality / Test (pull_request) Successful in 16s
quality / Lint (pull_request) Successful in 21s
quality / Build (pull_request) Successful in 44s
a2fc967b23
barrettruth deleted branch issue-320-task-input-normalization 2026-05-11 20:05:03 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
barrettruth/delta!343
No description provided.