refactor(validations): split lib/validations.ts into a barrel'd folder (slice 1)
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]>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
c8c60358c7
commit
18d5e22ad4
@@ -0,0 +1,20 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const createAreaSchema = z.object({
|
||||
code: z
|
||||
.string()
|
||||
.min(1, 'Code is required')
|
||||
.max(40)
|
||||
.regex(/^[a-z0-9-]+$/, 'Code must be lowercase letters, numbers, and hyphens only'),
|
||||
name: z.string().min(1, 'Name is required').max(80),
|
||||
icon: z.string().max(20).optional().nullable(),
|
||||
sort_order: z.number().int().min(0).max(100000).optional(),
|
||||
})
|
||||
|
||||
export const updateAreaSchema = z.object({
|
||||
areaId: z.string().uuid('Invalid area ID'),
|
||||
name: z.string().min(1).max(80).optional(),
|
||||
icon: z.string().max(20).optional().nullable(),
|
||||
sort_order: z.number().int().min(0).max(100000).optional(),
|
||||
is_archived: z.boolean().optional(),
|
||||
})
|
||||
Reference in New Issue
Block a user