feat: add date_of_birth field to persons across all layers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-11 09:06:29 +02:00
parent d2f282eb4c
commit 6dccf87234
18 changed files with 161 additions and 17 deletions

View File

@@ -40,6 +40,7 @@ const { errors, defineField, validateField, setFieldValue } = useForm({
first_name: '',
last_name: '',
email: '',
date_of_birth: '',
phone: '',
tshirt_size: '',
first_aid: false,
@@ -53,6 +54,7 @@ const { errors, defineField, validateField, setFieldValue } = useForm({
const [firstName] = defineField('first_name')
const [lastName] = defineField('last_name')
const [dateOfBirth] = defineField('date_of_birth')
const [email] = defineField('email')
const [phone] = defineField('phone')
const [tshirtSize] = defineField('tshirt_size')
@@ -157,10 +159,10 @@ const formattedDates = computed(() => {
})
// Step field mapping for validation (0-based)
type FormField = 'first_name' | 'last_name' | 'email' | 'phone' | 'tshirt_size' | 'first_aid' | 'allergies' | 'access_requirements' | 'driving_licence' | 'motivation' | 'motivation_other'
type FormField = 'first_name' | 'last_name' | 'date_of_birth' | 'email' | 'phone' | 'tshirt_size' | 'first_aid' | 'allergies' | 'access_requirements' | 'driving_licence' | 'motivation' | 'motivation_other'
const stepFields: Record<number, FormField[]> = {
0: ['first_name', 'last_name', 'email', 'phone'],
0: ['first_name', 'last_name', 'date_of_birth', 'email', 'phone'],
1: ['tshirt_size', 'first_aid', 'allergies', 'access_requirements', 'driving_licence'],
2: ['motivation', 'motivation_other'],
}
@@ -270,6 +272,7 @@ async function onSubmit() {
const payload: VolunteerRegistrationForm = {
first_name: firstName.value ?? '',
last_name: lastName.value ?? '',
date_of_birth: dateOfBirth.value ?? '',
email: email.value ?? '',
phone: phone.value ?? '',
tshirt_size: tshirtSize.value ?? '',
@@ -678,6 +681,19 @@ async function onSubmit() {
density="comfortable"
/>
</VCol>
<VCol
cols="12"
md="6"
>
<VTextField
v-model="dateOfBirth"
label="Geboortedatum"
type="date"
:error-messages="errors.date_of_birth"
density="comfortable"
/>
</VCol>
</VRow>
</div>

View File

@@ -4,6 +4,7 @@ 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('')),
})

View File

@@ -44,6 +44,7 @@ export interface VolunteerRegistrationForm {
// Step 1
first_name: string
last_name: string
date_of_birth: string
email: string
phone: string
// Step 2