- Add GET /api/v1/public/events/{slug}/registration-data endpoint for fetching
event sections and time slots without auth
- Create 5-step registration form: personal info, details, motivation, section
preferences, availability
- VeeValidate + Zod validation per step with Dutch error messages
- Auth-aware: pre-fills name/email for authenticated users
- Mobile responsive with custom chip-based step indicator
- Success page with contextual actions (dashboard vs login)
- Types, composable (TanStack Query), and Zod schemas
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
25 lines
910 B
TypeScript
25 lines
910 B
TypeScript
import { z } from 'zod'
|
|
|
|
export const step1Schema = z.object({
|
|
name: z.string().min(1, 'Naam is verplicht').max(255),
|
|
email: z.string().min(1, 'E-mailadres is verplicht').email('Ongeldig e-mailadres').max(255),
|
|
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('')),
|
|
access_requirements: 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)
|