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) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
c8c60358c7
commit
18d5e22ad4
@@ -0,0 +1,26 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const onboardingStepTypeSchema = z.enum(['welcome', 'code_of_conduct', 'profile', 'payment', 'content', 'form'])
|
||||
|
||||
export const createOnboardingStepSchema = z.object({
|
||||
step_type: onboardingStepTypeSchema,
|
||||
title: z.string().min(1, 'Title is required').max(200),
|
||||
body: z.string().max(50000).optional().nullable(),
|
||||
config: z.record(z.unknown()).optional(),
|
||||
is_enabled: z.boolean().optional(),
|
||||
is_required: z.boolean().optional(),
|
||||
sort_order: z.number().int().min(0).max(100000).optional(),
|
||||
})
|
||||
|
||||
export const updateOnboardingStepSchema = z.object({
|
||||
title: z.string().min(1).max(200).optional(),
|
||||
body: z.string().max(50000).optional().nullable(),
|
||||
config: z.record(z.unknown()).optional(),
|
||||
is_enabled: z.boolean().optional(),
|
||||
is_required: z.boolean().optional(),
|
||||
sort_order: z.number().int().min(0).max(100000).optional(),
|
||||
})
|
||||
|
||||
export const discloseAffiliationsSchema = z.object({
|
||||
affiliations: z.array(z.string().min(1).max(200)).max(50).default([]),
|
||||
})
|
||||
Reference in New Issue
Block a user