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:
@@ -194,7 +194,9 @@ Persons are sorted: available first, then unavailable (conflict), then already a
|
||||
"data": [
|
||||
{
|
||||
"id": "ulid",
|
||||
"name": "Jan de Vries",
|
||||
"first_name": "Jan",
|
||||
"last_name": "de Vries",
|
||||
"full_name": "Jan de Vries",
|
||||
"email": "jan@gmail.com",
|
||||
"status": "approved",
|
||||
"crowd_type": { "id": "ulid", "name": "Vrijwilliger", "system_type": "VOLUNTEER" },
|
||||
@@ -204,7 +206,9 @@ Persons are sorted: available first, then unavailable (conflict), then already a
|
||||
},
|
||||
{
|
||||
"id": "ulid",
|
||||
"name": "Ahmed Hassan",
|
||||
"first_name": "Ahmed",
|
||||
"last_name": "Hassan",
|
||||
"full_name": "Ahmed Hassan",
|
||||
"email": "ahmed.h@gmail.com",
|
||||
"status": "approved",
|
||||
"crowd_type": { "id": "ulid", "name": "Vrijwilliger", "system_type": "VOLUNTEER" },
|
||||
@@ -374,7 +378,7 @@ Response: `{ "confirmed": 2, "errors": [{ "match_id": "ulid3", "error": "User al
|
||||
{
|
||||
"pending_identity_match": {
|
||||
"match_id": "ulid",
|
||||
"matched_user": { "id": "ulid", "name": "Jan", "email": "jan@example.nl" },
|
||||
"matched_user": { "id": "ulid", "first_name": "Jan", "last_name": "", "full_name": "Jan", "email": "jan@example.nl" },
|
||||
"matched_on": "email",
|
||||
"confidence": "exact"
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@
|
||||
| Column | Type | Notes |
|
||||
| ------------------- | ------------------ | ------------------------- |
|
||||
| `id` | ULID | PK, `HasUlids` trait |
|
||||
| `name` | string | |
|
||||
| `first_name` | string | |
|
||||
| `last_name` | string | |
|
||||
| `email` | string | unique |
|
||||
| `password` | string | hashed |
|
||||
| `timezone` | string | default: Europe/Amsterdam |
|
||||
@@ -661,7 +662,8 @@ $effectiveDate = $shift->end_date ?? $shift->timeSlot->date;
|
||||
| `event_id` | ULID FK | → events — **v1.7** always references top-level event (festival or flat event) |
|
||||
| `crowd_type_id` | ULID FK | → crowd_types |
|
||||
| `company_id` | ULID FK nullable | → companies |
|
||||
| `name` | string | |
|
||||
| `first_name` | string | |
|
||||
| `last_name` | string | |
|
||||
| `email` | string | Indexed deduplication key |
|
||||
| `phone` | string nullable | |
|
||||
| `status` | enum | `invited\|applied\|pending\|approved\|rejected\|no_show` |
|
||||
@@ -683,9 +685,10 @@ $effectiveDate = $shift->end_date ?? $shift->timeSlot->date;
|
||||
| `id` | ULID | PK |
|
||||
| `organisation_id` | ULID FK | → organisations |
|
||||
| `name` | string | |
|
||||
| `type` | enum | `supplier\|partner\|agency\|venue\|other` |
|
||||
| `contact_name` | string nullable | |
|
||||
| `contact_email` | string nullable | |
|
||||
| `type` | enum | `supplier\|partner\|agency\|venue\|other` |
|
||||
| `contact_first_name` | string nullable | |
|
||||
| `contact_last_name` | string nullable | |
|
||||
| `contact_email` | string nullable | |
|
||||
| `contact_phone` | string nullable | |
|
||||
| `deleted_at` | timestamp nullable | Soft delete |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user