26 lines
973 B
TypeScript
26 lines
973 B
TypeScript
import { z } from 'zod'
|
|
|
|
export const step1Schema = z.object({
|
|
first_name: z.string().min(1, 'Voornaam is verplicht').max(255),
|
|
last_name: z.string().min(1, 'Achternaam is verplicht').max(255),
|
|
email: z.string().min(1, 'E-mailadres is verplicht').email('Ongeldig e-mailadres').max(255),
|
|
date_of_birth: z.string().optional().or(z.literal('')),
|
|
phone: z.string().max(50).optional().or(z.literal('')),
|
|
})
|
|
|
|
export const step2Schema = z.object({
|
|
tshirt_size: z.enum(['XS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL']).optional().or(z.literal('')),
|
|
first_aid: z.boolean().default(false),
|
|
allergies: z.string().max(500).optional().or(z.literal('')),
|
|
driving_licence: z.boolean().default(false),
|
|
})
|
|
|
|
export const step3Schema = z.object({
|
|
motivation: z.string().max(1000).optional().or(z.literal('')),
|
|
motivation_other: z.string().max(500).optional().or(z.literal('')),
|
|
})
|
|
|
|
export const fullRegistrationSchema = step1Schema
|
|
.merge(step2Schema)
|
|
.merge(step3Schema)
|