feat: split name into first_name + last_name across users, persons, and companies
Cross-cutting migration affecting the entire stack: - Database: 3 migrations splitting name columns with data migration - Models: first_name/last_name on User, Person; contact_first_name/contact_last_name on Company; backward-compatible name accessors - API: all resources return first_name, last_name, full_name; assignablePersons endpoint updated - Requests: validation rules updated for all person/user/company forms - Services: VolunteerRegistrationService, ShiftAssignmentService, InvitationService updated - Frontend: TypeScript types, Zod schemas, all forms split into Voornaam/Achternaam fields - Display: all person/user name references use full_name; initials use first_name[0]+last_name[0] - Tests: all 371 tests passing - Docs: SCHEMA.md and API.md updated Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -105,7 +105,7 @@ const filteredPersons = computed(() => {
|
||||
return assignableData.value.persons.filter((person) => {
|
||||
if (searchQuery.value) {
|
||||
const q = searchQuery.value.toLowerCase()
|
||||
if (!person.name.toLowerCase().includes(q) && !person.email.toLowerCase().includes(q)) {
|
||||
if (!person.full_name.toLowerCase().includes(q) && !person.email.toLowerCase().includes(q)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -145,7 +145,7 @@ const sortedPersons = computed(() => {
|
||||
if (a.has_availability !== b.has_availability) return a.has_availability ? -1 : 1
|
||||
if (a.tags.length !== b.tags.length) return b.tags.length - a.tags.length
|
||||
|
||||
return a.name.localeCompare(b.name)
|
||||
return a.full_name.localeCompare(b.full_name)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -258,7 +258,7 @@ async function executeAssign(person: AssignablePerson) {
|
||||
personId: person.id,
|
||||
})
|
||||
emit('assigned')
|
||||
successName.value = person.name
|
||||
successName.value = person.full_name
|
||||
showSuccess.value = true
|
||||
}
|
||||
catch (error: any) {
|
||||
@@ -412,12 +412,12 @@ async function executeAssign(person: AssignablePerson) {
|
||||
:color="person.is_available ? 'primary' : 'grey'"
|
||||
variant="tonal"
|
||||
>
|
||||
<span class="text-caption">{{ getInitials(person.name) }}</span>
|
||||
<span class="text-caption">{{ getInitials(person.full_name) }}</span>
|
||||
</VAvatar>
|
||||
</template>
|
||||
|
||||
<VListItemTitle class="d-flex align-center ga-2">
|
||||
{{ person.name }}
|
||||
{{ person.full_name }}
|
||||
<VTooltip
|
||||
v-if="getRecommendationReasons(person).length"
|
||||
location="top"
|
||||
@@ -641,7 +641,7 @@ async function executeAssign(person: AssignablePerson) {
|
||||
<VCardText class="px-5">
|
||||
Deze shift heeft {{ shift?.slots_total }} plekken en
|
||||
{{ shift?.filled_slots }} zijn bezet. Wil je
|
||||
<strong>{{ pendingPerson?.name }}</strong> toch toewijzen?
|
||||
<strong>{{ pendingPerson?.full_name }}</strong> toch toewijzen?
|
||||
</VCardText>
|
||||
<VCardActions class="px-5 pb-5">
|
||||
<VSpacer />
|
||||
@@ -673,7 +673,7 @@ async function executeAssign(person: AssignablePerson) {
|
||||
Vrijwilliger opnieuw toewijzen?
|
||||
</VCardTitle>
|
||||
<VCardText class="px-5">
|
||||
<strong>{{ pendingPerson?.name }}</strong> heeft zichzelf afgemeld
|
||||
<strong>{{ pendingPerson?.full_name }}</strong> heeft zichzelf afgemeld
|
||||
voor deze shift. Weet je zeker dat je deze persoon opnieuw wilt toewijzen?
|
||||
</VCardText>
|
||||
<VCardActions class="px-5 pb-5">
|
||||
|
||||
@@ -75,7 +75,7 @@ async function executeReassign(assignment: ShiftAssignment) {
|
||||
shiftId: assignment.shift_id,
|
||||
personId: assignment.person_id,
|
||||
})
|
||||
successMessage.value = `${assignment.person?.name ?? 'Persoon'} opnieuw toegewezen`
|
||||
successMessage.value = `${assignment.person?.full_name ?? 'Persoon'} opnieuw toegewezen`
|
||||
showSuccess.value = true
|
||||
}
|
||||
catch {
|
||||
@@ -186,7 +186,7 @@ const successMessage = ref('')
|
||||
function onApprove(assignment: ShiftAssignment) {
|
||||
approveAssignment(assignment.id, {
|
||||
onSuccess: () => {
|
||||
successMessage.value = `${assignment.person?.name ?? 'Toewijzing'} goedgekeurd`
|
||||
successMessage.value = `${assignment.person?.full_name ?? 'Toewijzing'} goedgekeurd`
|
||||
showSuccess.value = true
|
||||
},
|
||||
})
|
||||
@@ -199,7 +199,7 @@ function onCancel(assignment: ShiftAssignment) {
|
||||
|
||||
function onCancelExecute() {
|
||||
if (!cancellingAssignment.value) return
|
||||
const name = cancellingAssignment.value.person?.name ?? 'Toewijzing'
|
||||
const name = cancellingAssignment.value.person?.full_name ?? 'Toewijzing'
|
||||
|
||||
cancelAssignment(cancellingAssignment.value.id, {
|
||||
onSuccess: () => {
|
||||
@@ -224,7 +224,7 @@ function onReject(assignment: ShiftAssignment) {
|
||||
|
||||
function onRejectExecute() {
|
||||
if (!rejectingAssignment.value) return
|
||||
const name = rejectingAssignment.value.person?.name ?? 'Toewijzing'
|
||||
const name = rejectingAssignment.value.person?.full_name ?? 'Toewijzing'
|
||||
|
||||
rejectAssignment(
|
||||
{
|
||||
@@ -644,14 +644,14 @@ function fillRateColor(): string {
|
||||
variant="tonal"
|
||||
>
|
||||
<span class="text-caption">
|
||||
{{ assignment.person ? getInitials(assignment.person.name) : '?' }}
|
||||
{{ assignment.person ? getInitials(assignment.person.full_name) : '?' }}
|
||||
</span>
|
||||
</VAvatar>
|
||||
|
||||
<div style="min-width: 0;" class="flex-grow-1">
|
||||
<div class="d-flex align-center gap-x-2 flex-wrap">
|
||||
<span class="text-body-2 font-weight-medium text-truncate">
|
||||
{{ assignment.person?.name ?? 'Onbekend' }}
|
||||
{{ assignment.person?.full_name ?? 'Onbekend' }}
|
||||
</span>
|
||||
<VChip
|
||||
v-if="assignment.status === ShiftAssignmentStatus.REJECTED"
|
||||
@@ -775,7 +775,7 @@ function fillRateColor(): string {
|
||||
<VCard title="Toewijzing afwijzen">
|
||||
<VCardText>
|
||||
Weet je zeker dat je de toewijzing van
|
||||
<strong>{{ rejectingAssignment?.person?.name ?? 'deze persoon' }}</strong>
|
||||
<strong>{{ rejectingAssignment?.person?.full_name ?? 'deze persoon' }}</strong>
|
||||
wilt afwijzen?
|
||||
|
||||
<VTextarea
|
||||
@@ -814,7 +814,7 @@ function fillRateColor(): string {
|
||||
<VCard title="Toewijzing annuleren">
|
||||
<VCardText>
|
||||
Weet je zeker dat je de toewijzing van
|
||||
<strong>{{ cancellingAssignment?.person?.name ?? 'deze persoon' }}</strong>
|
||||
<strong>{{ cancellingAssignment?.person?.full_name ?? 'deze persoon' }}</strong>
|
||||
wilt annuleren?
|
||||
</VCardText>
|
||||
<VCardActions>
|
||||
@@ -877,7 +877,7 @@ function fillRateColor(): string {
|
||||
Vrijwilliger opnieuw toewijzen?
|
||||
</VCardTitle>
|
||||
<VCardText class="px-5">
|
||||
<strong>{{ reassigningAssignment?.person?.name ?? 'Deze persoon' }}</strong>
|
||||
<strong>{{ reassigningAssignment?.person?.full_name ?? 'Deze persoon' }}</strong>
|
||||
heeft zichzelf afgemeld voor deze shift. Weet je zeker dat je deze
|
||||
persoon opnieuw wilt toewijzen?
|
||||
</VCardText>
|
||||
|
||||
Reference in New Issue
Block a user