1141-line lib/validations.ts → lib/validations/<feature>.ts + primitives.ts + an index.ts barrel. '@/lib/validations' now resolves to the barrel, so all 40 importers are untouched. Every one of the 143 exports is preserved verbatim (verified by symbol-diff); schemas moved unchanged. tsc 0, 635 tests green. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
16 lines
625 B
TypeScript
16 lines
625 B
TypeScript
import { z } from 'zod'
|
|
import { flexibleDateTime } from './primitives'
|
|
|
|
export const createTaskSchema = z.object({
|
|
title: z.string().min(1, 'Title is required').max(200, 'Title is too long'),
|
|
description: z.string().max(2000, 'Description is too long').optional(),
|
|
type: z.enum(['task', 'chore']).default('task'),
|
|
area: z.string().max(100).optional(),
|
|
recurrence: z.enum(['none', 'daily', 'weekly', 'biweekly', 'monthly']).default('none'),
|
|
due_date: flexibleDateTime().optional(),
|
|
})
|
|
|
|
export const taskIdSchema = z.string().uuid('Invalid task ID')
|
|
|
|
export type CreateTaskInput = z.infer<typeof createTaskSchema>
|