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]>
18 lines
620 B
TypeScript
18 lines
620 B
TypeScript
import { z } from 'zod'
|
|
import { flexibleDateTime } from './primitives'
|
|
|
|
export const createProjectSchema = z.object({
|
|
title: z.string().min(1, 'Title is required').max(200),
|
|
description: z.string().max(2000).optional(),
|
|
area: z.string().max(100).optional(),
|
|
tags: z.array(z.string().max(50)).max(20).optional(),
|
|
due_date: flexibleDateTime().optional(),
|
|
})
|
|
|
|
export const updateProjectStatusSchema = z.object({
|
|
projectId: z.string().uuid('Invalid project ID'),
|
|
status: z.enum(['backlog', 'in_progress', 'review', 'done', 'blocked']),
|
|
})
|
|
|
|
export type CreateProjectInput = z.infer<typeof createProjectSchema>
|