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:
2026-04-10 23:04:55 +02:00
parent bd4297f891
commit d2f282eb4c
66 changed files with 654 additions and 220 deletions

View File

@@ -152,13 +152,14 @@ class InvitationTest extends TestCase
]);
$response = $this->postJson("/api/v1/invitations/{$invitation->token}/accept", [
'name' => 'New User',
'first_name' => 'New',
'last_name' => 'User',
'password' => 'password123',
'password_confirmation' => 'password123',
]);
$response->assertOk();
$response->assertJsonStructure(['data' => ['user' => ['id', 'name', 'email'], 'token']]);
$response->assertJsonStructure(['data' => ['user' => ['id', 'first_name', 'last_name', 'full_name', 'email'], 'token']]);
$this->assertDatabaseHas('users', ['email' => 'newuser@test.nl']);
$this->assertDatabaseHas('organisation_user', [
@@ -204,7 +205,8 @@ class InvitationTest extends TestCase
]);
$response = $this->postJson("/api/v1/invitations/{$invitation->token}/accept", [
'name' => 'Test',
'first_name' => 'Test',
'last_name' => 'User',
'password' => 'password123',
'password_confirmation' => 'password123',
]);
@@ -222,7 +224,8 @@ class InvitationTest extends TestCase
]);
$response = $this->postJson("/api/v1/invitations/{$invitation->token}/accept", [
'name' => 'Test',
'first_name' => 'Test',
'last_name' => 'User',
'password' => 'password123',
'password_confirmation' => 'password123',
]);