security: A01-13 — nest all event routes under organisation prefix
Move all authenticated organiser-facing event sub-resource routes from
/events/{event}/... to /organisations/{organisation}/events/{event}/...
to enforce multi-tenancy at the routing layer.
Changes:
- Routes: restructured api.php to nest all event sub-resources under
the existing organisation prefix group
- Controllers: added Organisation parameter and VerifiesOrganisationEvent
trait to all 12 affected controllers (sections, time-slots, shifts,
persons, crowd-lists, locations, shift-assignments, registration-fields,
availabilities, field-values, section-preferences, stats)
- Tests: updated all 20 feature test files with new route paths
- Frontend: updated 8 API composables and 20 Vue components/pages
- API.md: updated documentation to reflect new route structure
Portal routes, public routes (volunteer-register), and invitation routes
remain unchanged as they operate without organisation context.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -90,7 +90,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -118,7 +118,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift2->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift2->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -143,7 +143,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -163,7 +163,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -175,7 +175,7 @@ class AssignablePersonsTest extends TestCase
|
||||
$shift = $this->createOpenShift();
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertUnauthorized();
|
||||
@@ -188,7 +188,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertForbidden();
|
||||
@@ -212,7 +212,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift2->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift2->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -231,7 +231,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -259,7 +259,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->otherSection->id}/shifts/{$shift2->id}/assign",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->otherSection->id}/shifts/{$shift2->id}/assign",
|
||||
['person_id' => $person->id],
|
||||
);
|
||||
|
||||
@@ -288,7 +288,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->otherSection->id}/shifts/{$shift2->id}/claim",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->otherSection->id}/shifts/{$shift2->id}/claim",
|
||||
['person_id' => $person->id],
|
||||
);
|
||||
|
||||
@@ -316,7 +316,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/shift-assignments/{$assignment->id}/cancel",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shift-assignments/{$assignment->id}/cancel",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -348,7 +348,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/assign",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/assign",
|
||||
['person_id' => $person->id],
|
||||
);
|
||||
|
||||
@@ -379,7 +379,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/assign",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/assign",
|
||||
['person_id' => $person->id],
|
||||
);
|
||||
|
||||
@@ -408,7 +408,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->otherSection->id}/shifts/{$shift2->id}/assign",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->otherSection->id}/shifts/{$shift2->id}/assign",
|
||||
['person_id' => $person->id],
|
||||
);
|
||||
|
||||
@@ -436,7 +436,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -463,7 +463,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -486,7 +486,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -523,7 +523,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -542,7 +542,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -568,7 +568,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -590,7 +590,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -607,7 +607,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -627,7 +627,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -642,7 +642,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -666,7 +666,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -692,7 +692,7 @@ class AssignablePersonsTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shifts/{$shift->id}/assignable-persons",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
|
||||
@@ -57,7 +57,7 @@ class PersonApprovalEmailTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons/{$person->id}/approve");
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$person->id}/approve");
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
@@ -79,7 +79,7 @@ class PersonApprovalEmailTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons/{$person->id}/reject", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$person->id}/reject", [
|
||||
'reason' => 'Geen beschikbaarheid op de juiste momenten.',
|
||||
]);
|
||||
|
||||
@@ -109,7 +109,7 @@ class PersonApprovalEmailTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons/{$person->id}/reject");
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$person->id}/reject");
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
@@ -127,7 +127,7 @@ class PersonApprovalEmailTest extends TestCase
|
||||
'status' => 'pending',
|
||||
]);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons/{$person->id}/approve");
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$person->id}/approve");
|
||||
|
||||
$response->assertStatus(401);
|
||||
}
|
||||
@@ -146,7 +146,7 @@ class PersonApprovalEmailTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($outsider);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons/{$person->id}/approve");
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$person->id}/approve");
|
||||
|
||||
$response->assertStatus(403);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class RegistrationSettingsTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->festival->id}/sections/registration-settings");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->festival->id}/sections/registration-settings");
|
||||
|
||||
$response->assertOk()
|
||||
->assertJsonCount(2, 'data');
|
||||
@@ -92,7 +92,7 @@ class RegistrationSettingsTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->festival->id}/sections/registration-settings", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->festival->id}/sections/registration-settings", [
|
||||
'name' => 'Theatertent Bar',
|
||||
'show_in_registration' => true,
|
||||
'registration_description' => 'Bediening in de overdekte theatertent',
|
||||
@@ -121,7 +121,7 @@ class RegistrationSettingsTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$this->putJson("/api/v1/events/{$this->festival->id}/sections/registration-settings", [
|
||||
$this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->festival->id}/sections/registration-settings", [
|
||||
'name' => 'EHBO',
|
||||
'show_in_registration' => true,
|
||||
'registration_description' => null,
|
||||
@@ -143,7 +143,7 @@ class RegistrationSettingsTest extends TestCase
|
||||
]);
|
||||
|
||||
// Unauthenticated
|
||||
$response = $this->putJson("/api/v1/events/{$this->festival->id}/sections/registration-settings", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->festival->id}/sections/registration-settings", [
|
||||
'name' => 'Bar',
|
||||
'show_in_registration' => true,
|
||||
'registration_description' => null,
|
||||
@@ -156,7 +156,7 @@ class RegistrationSettingsTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->festival->id}/sections/registration-settings", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->festival->id}/sections/registration-settings", [
|
||||
'name' => 'Nonexistent Section',
|
||||
'show_in_registration' => true,
|
||||
'registration_description' => null,
|
||||
@@ -167,7 +167,7 @@ class RegistrationSettingsTest extends TestCase
|
||||
|
||||
public function test_get_requires_authentication(): void
|
||||
{
|
||||
$response = $this->getJson("/api/v1/events/{$this->festival->id}/sections/registration-settings");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->festival->id}/sections/registration-settings");
|
||||
|
||||
$response->assertUnauthorized();
|
||||
}
|
||||
@@ -187,7 +187,7 @@ class RegistrationSettingsTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$flatEvent->id}/sections/registration-settings");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$flatEvent->id}/sections/registration-settings");
|
||||
|
||||
$response->assertOk()
|
||||
->assertJsonCount(1, 'data')
|
||||
|
||||
@@ -89,7 +89,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->volunteer);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/claim",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/claim",
|
||||
['person_id' => $this->person->id],
|
||||
);
|
||||
|
||||
@@ -115,7 +115,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->volunteer);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$autoSection->id}/shifts/{$shift->id}/claim",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$autoSection->id}/shifts/{$shift->id}/claim",
|
||||
['person_id' => $this->person->id],
|
||||
);
|
||||
|
||||
@@ -142,7 +142,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->volunteer);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/claim",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/claim",
|
||||
['person_id' => $this->person->id],
|
||||
);
|
||||
|
||||
@@ -162,7 +162,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->volunteer);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/claim",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/claim",
|
||||
['person_id' => $this->person->id],
|
||||
);
|
||||
|
||||
@@ -185,7 +185,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->volunteer);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift2->id}/claim",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift2->id}/claim",
|
||||
['person_id' => $this->person->id],
|
||||
);
|
||||
|
||||
@@ -208,7 +208,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->volunteer);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift2->id}/claim",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift2->id}/claim",
|
||||
['person_id' => $this->person->id],
|
||||
);
|
||||
|
||||
@@ -227,7 +227,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->volunteer);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/claim",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/claim",
|
||||
['person_id' => $pendingPerson->id],
|
||||
);
|
||||
|
||||
@@ -239,7 +239,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
$shift = $this->createOpenShift();
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/claim",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/claim",
|
||||
['person_id' => $this->person->id],
|
||||
);
|
||||
|
||||
@@ -257,7 +257,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/assign",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/assign",
|
||||
['person_id' => $this->person->id],
|
||||
);
|
||||
|
||||
@@ -282,7 +282,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/assign",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/assign",
|
||||
['person_id' => $this->person->id],
|
||||
);
|
||||
|
||||
@@ -306,7 +306,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/assign",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/assign",
|
||||
['person_id' => $this->person->id],
|
||||
);
|
||||
|
||||
@@ -333,7 +333,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift2->id}/assign",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift2->id}/assign",
|
||||
['person_id' => $this->person->id],
|
||||
);
|
||||
|
||||
@@ -347,7 +347,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->volunteer);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/assign",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/assign",
|
||||
['person_id' => $this->person->id],
|
||||
);
|
||||
|
||||
@@ -371,7 +371,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/shift-assignments/{$assignment->id}/approve",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shift-assignments/{$assignment->id}/approve",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -397,7 +397,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/shift-assignments/{$assignment->id}/reject",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shift-assignments/{$assignment->id}/reject",
|
||||
['reason' => 'Onvoldoende ervaring voor deze rol.'],
|
||||
);
|
||||
|
||||
@@ -418,7 +418,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/shift-assignments/{$assignment->id}/approve",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shift-assignments/{$assignment->id}/approve",
|
||||
);
|
||||
|
||||
$response->assertUnprocessable();
|
||||
@@ -437,7 +437,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->volunteer);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/shift-assignments/{$assignment->id}/cancel",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shift-assignments/{$assignment->id}/cancel",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -456,7 +456,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->volunteer);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/shift-assignments/{$assignment->id}/cancel",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shift-assignments/{$assignment->id}/cancel",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -480,7 +480,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->volunteer);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/shift-assignments/{$assignment->id}/cancel",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shift-assignments/{$assignment->id}/cancel",
|
||||
);
|
||||
|
||||
$response->assertForbidden();
|
||||
@@ -502,7 +502,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/shift-assignments/{$assignment->id}/cancel",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shift-assignments/{$assignment->id}/cancel",
|
||||
);
|
||||
|
||||
$response->assertOk()
|
||||
@@ -530,7 +530,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/shift-assignments/bulk-approve",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shift-assignments/bulk-approve",
|
||||
['assignment_ids' => $assignments->pluck('id')->toArray()],
|
||||
);
|
||||
|
||||
@@ -570,7 +570,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/shift-assignments/bulk-approve",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shift-assignments/bulk-approve",
|
||||
['assignment_ids' => [$pending->id, $approved->id]],
|
||||
);
|
||||
|
||||
@@ -605,7 +605,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/shift-assignments");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shift-assignments");
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertCount(3, $response->json('data'));
|
||||
@@ -633,7 +633,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/shift-assignments?status=pending_approval");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shift-assignments?status=pending_approval");
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertCount(1, $response->json('data'));
|
||||
@@ -651,7 +651,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/claim",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/claim",
|
||||
['person_id' => $this->person->id],
|
||||
);
|
||||
|
||||
@@ -671,7 +671,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/shift-assignments/{$assignment->id}/approve",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/shift-assignments/{$assignment->id}/approve",
|
||||
);
|
||||
|
||||
$response->assertForbidden();
|
||||
@@ -688,7 +688,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/persons/{$this->person->id}/availabilities/sync",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/availabilities/sync",
|
||||
[
|
||||
'availabilities' => [
|
||||
['time_slot_id' => $this->timeSlot->id, 'preference_level' => 5],
|
||||
@@ -721,7 +721,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/persons/{$this->person->id}/availabilities/sync",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/availabilities/sync",
|
||||
[
|
||||
'availabilities' => [
|
||||
['time_slot_id' => $slot2->id, 'preference_level' => 4],
|
||||
@@ -752,7 +752,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/persons/{$this->person->id}/availabilities/sync",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/availabilities/sync",
|
||||
[
|
||||
'availabilities' => [
|
||||
['time_slot_id' => $otherSlot->id, 'preference_level' => 3],
|
||||
@@ -766,7 +766,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
public function test_unauthenticated_sync_returns_401(): void
|
||||
{
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/persons/{$this->person->id}/availabilities/sync",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/availabilities/sync",
|
||||
['availabilities' => []],
|
||||
);
|
||||
|
||||
@@ -784,7 +784,7 @@ class ShiftAssignmentWorkflowTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson(
|
||||
"/api/v1/events/{$this->event->id}/persons/{$this->person->id}/availabilities",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/availabilities",
|
||||
);
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
@@ -72,7 +72,7 @@ class CrowdListTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/crowd-lists");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists");
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertCount(3, $response->json('data'));
|
||||
@@ -86,7 +86,7 @@ class CrowdListTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/crowd-lists", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists", [
|
||||
'crowd_type_id' => $this->crowdType->id,
|
||||
'name' => 'VIP Gastenlijst',
|
||||
'type' => 'internal',
|
||||
@@ -116,7 +116,7 @@ class CrowdListTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/crowd-lists", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists", [
|
||||
'crowd_type_id' => $this->crowdType->id,
|
||||
'name' => 'Catering Medewerkers',
|
||||
'type' => 'external',
|
||||
@@ -132,7 +132,7 @@ class CrowdListTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/crowd-lists", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists", [
|
||||
'crowd_type_id' => $this->crowdType->id,
|
||||
'name' => 'Test List',
|
||||
'type' => 'invalid_type',
|
||||
@@ -154,7 +154,7 @@ class CrowdListTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/crowd-lists/{$crowdList->id}", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists/{$crowdList->id}", [
|
||||
'name' => 'Nieuwe Naam',
|
||||
'auto_approve' => true,
|
||||
'max_persons' => 25,
|
||||
@@ -175,7 +175,7 @@ class CrowdListTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->deleteJson("/api/v1/events/{$this->event->id}/crowd-lists/{$crowdList->id}");
|
||||
$response = $this->deleteJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists/{$crowdList->id}");
|
||||
|
||||
$response->assertNoContent();
|
||||
$this->assertDatabaseMissing('crowd_lists', ['id' => $crowdList->id]);
|
||||
@@ -196,7 +196,7 @@ class CrowdListTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons", [
|
||||
'person_id' => $person->id,
|
||||
]);
|
||||
|
||||
@@ -227,7 +227,7 @@ class CrowdListTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons", [
|
||||
'person_id' => $person->id,
|
||||
]);
|
||||
|
||||
@@ -258,7 +258,7 @@ class CrowdListTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
// Try to add 3rd person
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons", [
|
||||
'person_id' => $persons->last()->id,
|
||||
]);
|
||||
|
||||
@@ -283,7 +283,7 @@ class CrowdListTest extends TestCase
|
||||
|
||||
// Add all 5 persons — no limit
|
||||
foreach ($persons as $person) {
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons", [
|
||||
'person_id' => $person->id,
|
||||
]);
|
||||
$response->assertOk();
|
||||
@@ -306,7 +306,7 @@ class CrowdListTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons", [
|
||||
'person_id' => $person->id,
|
||||
]);
|
||||
|
||||
@@ -336,7 +336,7 @@ class CrowdListTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->deleteJson("/api/v1/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons/{$person->id}");
|
||||
$response = $this->deleteJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons/{$person->id}");
|
||||
|
||||
$response->assertNoContent();
|
||||
|
||||
@@ -370,7 +370,7 @@ class CrowdListTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/crowd-lists");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists");
|
||||
|
||||
$response->assertOk();
|
||||
$listData = collect($response->json('data'))->firstWhere('id', $crowdList->id);
|
||||
@@ -400,7 +400,7 @@ class CrowdListTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons");
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertCount(3, $response->json('data'));
|
||||
@@ -433,7 +433,7 @@ class CrowdListTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons");
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertJsonStructure([
|
||||
@@ -454,7 +454,7 @@ class CrowdListTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists/{$crowdList->id}/persons");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
@@ -465,14 +465,14 @@ class CrowdListTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/crowd-lists");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
|
||||
public function test_unauthenticated_cannot_access_crowd_lists(): void
|
||||
{
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/crowd-lists");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists");
|
||||
|
||||
$response->assertUnauthorized();
|
||||
}
|
||||
@@ -490,7 +490,7 @@ class CrowdListTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
// Try to update a list from event A via event B's URL
|
||||
$response = $this->putJson("/api/v1/events/{$eventB->id}/crowd-lists/{$crowdList->id}", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$eventB->id}/crowd-lists/{$crowdList->id}", [
|
||||
'name' => 'Hacked',
|
||||
]);
|
||||
|
||||
@@ -517,7 +517,7 @@ class CrowdListTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$this->deleteJson("/api/v1/events/{$this->event->id}/crowd-lists/{$crowdList->id}")
|
||||
$this->deleteJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists/{$crowdList->id}")
|
||||
->assertNoContent();
|
||||
|
||||
// Pivot removed (cascade)
|
||||
@@ -553,7 +553,7 @@ class CrowdListTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/crowd-lists");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/crowd-lists");
|
||||
|
||||
$response->assertOk();
|
||||
$listData = collect($response->json('data'))->firstWhere('id', $crowdList->id);
|
||||
|
||||
@@ -115,7 +115,7 @@ class EventStatsTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/stats");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/stats");
|
||||
|
||||
$response->assertOk();
|
||||
$data = $response->json('data');
|
||||
@@ -159,7 +159,7 @@ class EventStatsTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/stats");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/stats");
|
||||
|
||||
$response->assertOk();
|
||||
$data = $response->json('data');
|
||||
@@ -171,7 +171,7 @@ class EventStatsTest extends TestCase
|
||||
|
||||
public function test_unauthenticated_cannot_access_stats(): void
|
||||
{
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/stats");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/stats");
|
||||
|
||||
$response->assertUnauthorized();
|
||||
}
|
||||
@@ -180,7 +180,7 @@ class EventStatsTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/stats");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/stats");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
@@ -189,7 +189,7 @@ class EventStatsTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/stats");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/stats");
|
||||
|
||||
$response->assertOk();
|
||||
$data = $response->json('data');
|
||||
|
||||
@@ -54,7 +54,7 @@ class FestivalEventTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->festival->id}/time-slots", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->festival->id}/time-slots", [
|
||||
'name' => 'Opbouw Vrijdag',
|
||||
'person_type' => 'CREW',
|
||||
'date' => '2026-07-10',
|
||||
@@ -81,7 +81,7 @@ class FestivalEventTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->festival->id}/sections", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->festival->id}/sections", [
|
||||
'name' => 'Terreinploeg',
|
||||
'sort_order' => 1,
|
||||
'type' => 'standard',
|
||||
@@ -112,7 +112,7 @@ class FestivalEventTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->festival->id}/sections/{$section->id}/shifts", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->festival->id}/sections/{$section->id}/shifts", [
|
||||
'time_slot_id' => $timeSlot->id,
|
||||
'title' => 'Terreinmedewerker',
|
||||
'slots_total' => 8,
|
||||
@@ -151,7 +151,7 @@ class FestivalEventTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->subEvent->id}/sections");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/sections");
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
@@ -181,7 +181,7 @@ class FestivalEventTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->subEvent->id}/time-slots");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/time-slots");
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
@@ -216,7 +216,7 @@ class FestivalEventTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
// Query persons on festival level — should only return festival-level persons
|
||||
$response = $this->getJson("/api/v1/events/{$this->festival->id}/persons");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->festival->id}/persons");
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
@@ -231,7 +231,7 @@ class FestivalEventTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->subEvent->id}/sections", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/sections", [
|
||||
'name' => 'EHBO',
|
||||
'type' => 'cross_event',
|
||||
]);
|
||||
@@ -258,7 +258,7 @@ class FestivalEventTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->festival->id}/sections", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->festival->id}/sections", [
|
||||
'name' => 'Security',
|
||||
'type' => 'cross_event',
|
||||
]);
|
||||
@@ -283,7 +283,7 @@ class FestivalEventTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$flatEvent->id}/sections", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$flatEvent->id}/sections", [
|
||||
'name' => 'EHBO',
|
||||
'type' => 'cross_event',
|
||||
]);
|
||||
@@ -298,13 +298,13 @@ class FestivalEventTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
// Create cross_event via sub-event A → redirects to parent
|
||||
$this->postJson("/api/v1/events/{$this->subEvent->id}/sections", [
|
||||
$this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/sections", [
|
||||
'name' => 'Verkeersregelaars',
|
||||
'type' => 'cross_event',
|
||||
])->assertCreated();
|
||||
|
||||
// Should appear in sub-event B's section list
|
||||
$response = $this->getJson("/api/v1/events/{$subEventB->id}/sections");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$subEventB->id}/sections");
|
||||
|
||||
$response->assertOk();
|
||||
$sectionNames = collect($response->json('data'))->pluck('name')->all();
|
||||
@@ -315,7 +315,7 @@ class FestivalEventTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->subEvent->id}/sections", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/sections", [
|
||||
'name' => 'Bar Schirmbar',
|
||||
'type' => 'standard',
|
||||
]);
|
||||
@@ -403,7 +403,7 @@ class FestivalEventTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->subEvent->id}/time-slots?include_parent=true");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/time-slots?include_parent=true");
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
@@ -439,7 +439,7 @@ class FestivalEventTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
// Even with include_parent, festival parent should only return its own TS
|
||||
$response = $this->getJson("/api/v1/events/{$this->festival->id}/time-slots?include_parent=true");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->festival->id}/time-slots?include_parent=true");
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
@@ -461,7 +461,7 @@ class FestivalEventTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->subEvent->id}/sections/{$section->id}/shifts", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/sections/{$section->id}/shifts", [
|
||||
'time_slot_id' => $festivalTimeSlot->id,
|
||||
'title' => 'Opbouwshift',
|
||||
'slots_total' => 4,
|
||||
@@ -494,7 +494,7 @@ class FestivalEventTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->subEvent->id}/sections/{$section->id}/shifts", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/sections/{$section->id}/shifts", [
|
||||
'time_slot_id' => $otherTimeSlot->id,
|
||||
'title' => 'Illegale shift',
|
||||
'slots_total' => 1,
|
||||
@@ -518,7 +518,7 @@ class FestivalEventTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
// include_parent has no effect on flat events
|
||||
$response = $this->getJson("/api/v1/events/{$flatEvent->id}/time-slots?include_parent=true");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$flatEvent->id}/time-slots?include_parent=true");
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
@@ -559,7 +559,7 @@ class FestivalEventTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
// Assign person to the shift
|
||||
$this->postJson("/api/v1/events/{$this->subEvent->id}/sections/{$section->id}/shifts/{$shift->id}/assign", [
|
||||
$this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/sections/{$section->id}/shifts/{$shift->id}/assign", [
|
||||
'person_id' => $person->id,
|
||||
])->assertCreated();
|
||||
|
||||
@@ -576,7 +576,7 @@ class FestivalEventTest extends TestCase
|
||||
]);
|
||||
|
||||
// Assigning the same person to same time_slot should fail
|
||||
$response = $this->postJson("/api/v1/events/{$this->subEvent->id}/sections/{$section2->id}/shifts/{$shift2->id}/assign", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/sections/{$section2->id}/shifts/{$shift2->id}/assign", [
|
||||
'person_id' => $person->id,
|
||||
]);
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class FestivalSectionTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/sections");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections");
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertCount(3, $response->json('data'));
|
||||
@@ -60,7 +60,7 @@ class FestivalSectionTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/sections");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
@@ -69,7 +69,7 @@ class FestivalSectionTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/sections", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections", [
|
||||
'name' => 'Bar',
|
||||
'sort_order' => 1,
|
||||
]);
|
||||
@@ -85,7 +85,7 @@ class FestivalSectionTest extends TestCase
|
||||
|
||||
public function test_store_unauthenticated_returns_401(): void
|
||||
{
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/sections", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections", [
|
||||
'name' => 'Bar',
|
||||
'sort_order' => 1,
|
||||
]);
|
||||
@@ -97,7 +97,7 @@ class FestivalSectionTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/sections", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections", [
|
||||
'sort_order' => 1,
|
||||
]);
|
||||
|
||||
@@ -114,7 +114,7 @@ class FestivalSectionTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/sections/{$section->id}", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$section->id}", [
|
||||
'name' => 'Bar Updated',
|
||||
]);
|
||||
|
||||
@@ -128,7 +128,7 @@ class FestivalSectionTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->deleteJson("/api/v1/events/{$this->event->id}/sections/{$section->id}");
|
||||
$response = $this->deleteJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$section->id}");
|
||||
|
||||
$response->assertNoContent();
|
||||
$this->assertSoftDeleted('festival_sections', ['id' => $section->id]);
|
||||
@@ -140,7 +140,7 @@ class FestivalSectionTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/sections/{$section->id}", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$section->id}", [
|
||||
'name' => 'Hacked',
|
||||
]);
|
||||
|
||||
@@ -153,7 +153,7 @@ class FestivalSectionTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->deleteJson("/api/v1/events/{$this->event->id}/sections/{$section->id}");
|
||||
$response = $this->deleteJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$section->id}");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
@@ -162,7 +162,7 @@ class FestivalSectionTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/sections", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections", [
|
||||
'name' => 'Tapkraan',
|
||||
'category' => 'Bar',
|
||||
'icon' => 'tabler-beer',
|
||||
@@ -237,7 +237,7 @@ class FestivalSectionTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/sections/reorder", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/reorder", [
|
||||
'sections' => [$sectionB->id, $sectionA->id],
|
||||
]);
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class LocationTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/locations");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/locations");
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertCount(3, $response->json('data'));
|
||||
@@ -62,7 +62,7 @@ class LocationTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/locations", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/locations", [
|
||||
'name' => 'Hoofdpodium',
|
||||
'address' => 'Museumplein 1, 1071 DJ Amsterdam',
|
||||
'lat' => 52.3580,
|
||||
@@ -85,7 +85,7 @@ class LocationTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/locations", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/locations", [
|
||||
'name' => 'Backstage Area',
|
||||
]);
|
||||
|
||||
@@ -105,7 +105,7 @@ class LocationTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/locations/{$location->id}", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/locations/{$location->id}", [
|
||||
'name' => 'Bar Zuid',
|
||||
'address' => 'Coolsingel 42, 3011 AD Rotterdam',
|
||||
'lat' => 51.9225,
|
||||
@@ -130,7 +130,7 @@ class LocationTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->deleteJson("/api/v1/events/{$this->event->id}/locations/{$location->id}");
|
||||
$response = $this->deleteJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/locations/{$location->id}");
|
||||
|
||||
$response->assertNoContent();
|
||||
$this->assertDatabaseMissing('locations', ['id' => $location->id]);
|
||||
@@ -142,7 +142,7 @@ class LocationTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/locations");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/locations");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
@@ -151,7 +151,7 @@ class LocationTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/locations", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/locations", [
|
||||
'name' => 'Hack Attempt',
|
||||
]);
|
||||
|
||||
@@ -166,7 +166,7 @@ class LocationTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/locations/{$location->id}", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/locations/{$location->id}", [
|
||||
'name' => 'Hack Attempt',
|
||||
]);
|
||||
|
||||
@@ -181,14 +181,14 @@ class LocationTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->deleteJson("/api/v1/events/{$this->event->id}/locations/{$location->id}");
|
||||
$response = $this->deleteJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/locations/{$location->id}");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
|
||||
public function test_unauthenticated_cannot_access_locations(): void
|
||||
{
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/locations");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/locations");
|
||||
|
||||
$response->assertUnauthorized();
|
||||
}
|
||||
@@ -199,7 +199,7 @@ class LocationTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/locations", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/locations", [
|
||||
'address' => 'Museumplein 1, Amsterdam',
|
||||
]);
|
||||
|
||||
@@ -211,7 +211,7 @@ class LocationTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/locations", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/locations", [
|
||||
'name' => str_repeat('a', 256),
|
||||
]);
|
||||
|
||||
@@ -223,7 +223,7 @@ class LocationTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/locations", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/locations", [
|
||||
'name' => 'Ongeldige Locatie',
|
||||
'lat' => 91.0,
|
||||
'lng' => 181.0,
|
||||
@@ -244,7 +244,7 @@ class LocationTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/locations");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/locations");
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertCount(2, $response->json('data'));
|
||||
@@ -258,7 +258,7 @@ class LocationTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/locations");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/locations");
|
||||
|
||||
$response->assertOk();
|
||||
$names = collect($response->json('data'))->pluck('name')->all();
|
||||
|
||||
@@ -55,7 +55,7 @@ class PersonTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/persons");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons");
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertCount(3, $response->json('data'));
|
||||
@@ -78,7 +78,7 @@ class PersonTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/persons?crowd_type_id={$this->crowdType->id}");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons?crowd_type_id={$this->crowdType->id}");
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertCount(2, $response->json('data'));
|
||||
@@ -93,7 +93,7 @@ class PersonTest extends TestCase
|
||||
// Outsider tries to access event from other org
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/persons");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
@@ -107,7 +107,7 @@ class PersonTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/persons/{$person->id}");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$person->id}");
|
||||
|
||||
$response->assertOk()
|
||||
->assertJsonPath('data.crowd_type.system_type', 'VOLUNTEER');
|
||||
@@ -117,7 +117,7 @@ class PersonTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons", [
|
||||
'crowd_type_id' => $this->crowdType->id,
|
||||
'first_name' => 'Jan',
|
||||
'last_name' => 'de Vries',
|
||||
@@ -146,7 +146,7 @@ class PersonTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/persons/{$person->id}", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$person->id}", [
|
||||
'status' => 'approved',
|
||||
]);
|
||||
|
||||
@@ -164,7 +164,7 @@ class PersonTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons/{$person->id}/approve");
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$person->id}/approve");
|
||||
|
||||
$response->assertOk()
|
||||
->assertJsonPath('data.status', 'approved');
|
||||
@@ -184,7 +184,7 @@ class PersonTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->deleteJson("/api/v1/events/{$this->event->id}/persons/{$person->id}");
|
||||
$response = $this->deleteJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$person->id}");
|
||||
|
||||
$response->assertNoContent();
|
||||
$this->assertSoftDeleted('persons', ['id' => $person->id]);
|
||||
@@ -192,7 +192,7 @@ class PersonTest extends TestCase
|
||||
|
||||
public function test_unauthenticated_returns_401(): void
|
||||
{
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/persons");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons");
|
||||
|
||||
$response->assertUnauthorized();
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class PersonFieldValueTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
'values' => [
|
||||
$field->slug => 'Jan Jansen',
|
||||
],
|
||||
@@ -85,7 +85,7 @@ class PersonFieldValueTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
'values' => [
|
||||
$field->slug => 'M',
|
||||
],
|
||||
@@ -108,7 +108,7 @@ class PersonFieldValueTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
'values' => [
|
||||
$field->slug => 'XXXXL',
|
||||
],
|
||||
@@ -125,7 +125,7 @@ class PersonFieldValueTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
'values' => [
|
||||
$field->slug => ['Vegetarisch', 'Glutenvrij'],
|
||||
],
|
||||
@@ -153,7 +153,7 @@ class PersonFieldValueTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
'values' => [
|
||||
$field->slug => true,
|
||||
],
|
||||
@@ -180,7 +180,7 @@ class PersonFieldValueTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
'values' => [
|
||||
$field->slug => null,
|
||||
],
|
||||
@@ -206,7 +206,7 @@ class PersonFieldValueTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
'values' => [
|
||||
$field->slug => [$tag1->id, $tag2->id],
|
||||
],
|
||||
@@ -230,7 +230,7 @@ class PersonFieldValueTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
'values' => [
|
||||
$field->slug => ['01JFAKE00000000000000TAGID'],
|
||||
],
|
||||
@@ -257,7 +257,7 @@ class PersonFieldValueTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
'values' => [
|
||||
$field->slug => [$tag->id],
|
||||
],
|
||||
@@ -288,7 +288,7 @@ class PersonFieldValueTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/field-values", [
|
||||
'values' => [
|
||||
$field->slug => [$tag->id],
|
||||
],
|
||||
@@ -316,7 +316,7 @@ class PersonFieldValueTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/persons/{$this->person->id}/field-values");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/field-values");
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertCount(1, $response->json('data'));
|
||||
@@ -338,7 +338,7 @@ class PersonFieldValueTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$this->deleteJson("/api/v1/events/{$this->event->id}/registration-fields/{$field->id}")
|
||||
$this->deleteJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/registration-fields/{$field->id}")
|
||||
->assertNoContent();
|
||||
|
||||
// Value persists with FK set to null (nullOnDelete)
|
||||
@@ -353,14 +353,14 @@ class PersonFieldValueTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/persons/{$this->person->id}/field-values");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/field-values");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
|
||||
public function test_unauthenticated_returns_401(): void
|
||||
{
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/persons/{$this->person->id}/field-values");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$this->person->id}/field-values");
|
||||
|
||||
$response->assertUnauthorized();
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ class PersonIdentityMatchTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons", [
|
||||
'crowd_type_id' => $this->crowdType->id,
|
||||
'first_name' => 'Jan',
|
||||
'last_name' => 'de Vries',
|
||||
@@ -92,7 +92,7 @@ class PersonIdentityMatchTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons", [
|
||||
'crowd_type_id' => $this->crowdType->id,
|
||||
'first_name' => 'Piet',
|
||||
'last_name' => 'Jansen',
|
||||
@@ -585,7 +585,7 @@ class PersonIdentityMatchTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/persons");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons");
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
@@ -608,7 +608,7 @@ class PersonIdentityMatchTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/persons");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons");
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ class PersonSectionPreferenceTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
'preferences' => [
|
||||
['festival_section_id' => $this->sectionA->id, 'priority' => 1],
|
||||
['festival_section_id' => $this->sectionB->id, 'priority' => 2],
|
||||
@@ -114,7 +114,7 @@ class PersonSectionPreferenceTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
// First: set 2 preferences
|
||||
$this->putJson("/api/v1/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
$this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
'preferences' => [
|
||||
['festival_section_id' => $this->sectionA->id, 'priority' => 1],
|
||||
['festival_section_id' => $this->sectionB->id, 'priority' => 2],
|
||||
@@ -124,7 +124,7 @@ class PersonSectionPreferenceTest extends TestCase
|
||||
$this->assertEquals(2, PersonSectionPreference::where('person_id', $this->person->id)->count());
|
||||
|
||||
// Second: replace with 1 different preference
|
||||
$this->putJson("/api/v1/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
$this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
'preferences' => [
|
||||
['festival_section_id' => $this->sectionC->id, 'priority' => 1],
|
||||
],
|
||||
@@ -146,7 +146,7 @@ class PersonSectionPreferenceTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
'preferences' => [
|
||||
['festival_section_id' => $this->sectionA->id, 'priority' => 1],
|
||||
['festival_section_id' => $this->sectionB->id, 'priority' => 1],
|
||||
@@ -161,7 +161,7 @@ class PersonSectionPreferenceTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
// Priority 0 should fail
|
||||
$response = $this->putJson("/api/v1/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
'preferences' => [
|
||||
['festival_section_id' => $this->sectionA->id, 'priority' => 0],
|
||||
],
|
||||
@@ -170,7 +170,7 @@ class PersonSectionPreferenceTest extends TestCase
|
||||
$response->assertUnprocessable();
|
||||
|
||||
// Priority 6 should fail
|
||||
$response = $this->putJson("/api/v1/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
'preferences' => [
|
||||
['festival_section_id' => $this->sectionA->id, 'priority' => 6],
|
||||
],
|
||||
@@ -188,7 +188,7 @@ class PersonSectionPreferenceTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
'preferences' => [
|
||||
['festival_section_id' => $this->sectionA->id, 'priority' => 1],
|
||||
['festival_section_id' => $this->sectionB->id, 'priority' => 2],
|
||||
@@ -212,7 +212,7 @@ class PersonSectionPreferenceTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
'preferences' => [
|
||||
['festival_section_id' => $otherSection->id, 'priority' => 1],
|
||||
],
|
||||
@@ -225,7 +225,7 @@ class PersonSectionPreferenceTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences", [
|
||||
'preferences' => [
|
||||
['festival_section_id' => $this->crossEventSection->id, 'priority' => 1],
|
||||
],
|
||||
@@ -255,7 +255,7 @@ class PersonSectionPreferenceTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences");
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertCount(2, $response->json('data'));
|
||||
@@ -265,14 +265,14 @@ class PersonSectionPreferenceTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
|
||||
public function test_unauthenticated_returns_401(): void
|
||||
{
|
||||
$response = $this->getJson("/api/v1/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->subEvent->id}/persons/{$this->person->id}/section-preferences");
|
||||
|
||||
$response->assertUnauthorized();
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ class UserOrganisationTagTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/persons/{$person->id}");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$person->id}");
|
||||
|
||||
$response->assertOk();
|
||||
$tags = $response->json('data.tags');
|
||||
@@ -306,7 +306,7 @@ class UserOrganisationTagTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/persons?tag={$this->tag1->id}");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons?tag={$this->tag1->id}");
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertCount(1, $response->json('data'));
|
||||
@@ -356,7 +356,7 @@ class UserOrganisationTagTest extends TestCase
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
// AND filter: must have both tag1 AND tag2
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/persons?tags={$this->tag1->id},{$this->tag2->id}");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons?tags={$this->tag1->id},{$this->tag2->id}");
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertCount(1, $response->json('data'));
|
||||
@@ -373,7 +373,7 @@ class UserOrganisationTagTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/persons/{$person->id}");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons/{$person->id}");
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertEquals([], $response->json('data.tags'));
|
||||
|
||||
@@ -171,7 +171,7 @@ class RegistrationFieldTemplateTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$event->id}/registration-fields/from-template", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$event->id}/registration-fields/from-template", [
|
||||
'template_id' => $template->id,
|
||||
]);
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class RegistrationFormFieldTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/registration-fields");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/registration-fields");
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertCount(3, $response->json('data'));
|
||||
@@ -78,7 +78,7 @@ class RegistrationFormFieldTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/registration-fields", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/registration-fields", [
|
||||
'label' => 'Shirtmaat',
|
||||
'field_type' => 'select',
|
||||
'options' => ['XS', 'S', 'M', 'L', 'XL'],
|
||||
@@ -98,7 +98,7 @@ class RegistrationFormFieldTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/registration-fields", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/registration-fields", [
|
||||
'label' => 'Shirtmaat',
|
||||
'field_type' => 'select',
|
||||
]);
|
||||
@@ -111,7 +111,7 @@ class RegistrationFormFieldTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/registration-fields", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/registration-fields", [
|
||||
'label' => 'Naam',
|
||||
'field_type' => 'text',
|
||||
'options' => ['A', 'B'],
|
||||
@@ -125,7 +125,7 @@ class RegistrationFormFieldTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/registration-fields", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/registration-fields", [
|
||||
'label' => 'Vaardigheden',
|
||||
'field_type' => 'tag_picker',
|
||||
'tag_category' => 'Vaardigheid',
|
||||
@@ -139,7 +139,7 @@ class RegistrationFormFieldTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/registration-fields", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/registration-fields", [
|
||||
'label' => 'Naam',
|
||||
'field_type' => 'text',
|
||||
'tag_category' => 'Vaardigheid',
|
||||
@@ -159,7 +159,7 @@ class RegistrationFormFieldTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/registration-fields", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/registration-fields", [
|
||||
'label' => 'Shirtmaat',
|
||||
'field_type' => 'text',
|
||||
]);
|
||||
@@ -180,7 +180,7 @@ class RegistrationFormFieldTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$otherEvent->id}/registration-fields", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$otherEvent->id}/registration-fields", [
|
||||
'label' => 'Shirtmaat',
|
||||
'field_type' => 'text',
|
||||
]);
|
||||
@@ -199,7 +199,7 @@ class RegistrationFormFieldTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/registration-fields/{$field->id}", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/registration-fields/{$field->id}", [
|
||||
'label' => 'New Label',
|
||||
]);
|
||||
|
||||
@@ -217,7 +217,7 @@ class RegistrationFormFieldTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/registration-fields/{$field->id}", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/registration-fields/{$field->id}", [
|
||||
'field_type' => 'select',
|
||||
]);
|
||||
|
||||
@@ -237,7 +237,7 @@ class RegistrationFormFieldTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->deleteJson("/api/v1/events/{$this->event->id}/registration-fields/{$field->id}");
|
||||
$response = $this->deleteJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/registration-fields/{$field->id}");
|
||||
|
||||
$response->assertNoContent();
|
||||
$this->assertDatabaseMissing('registration_form_fields', [
|
||||
@@ -262,7 +262,7 @@ class RegistrationFormFieldTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/registration-fields/reorder", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/registration-fields/reorder", [
|
||||
'ids' => [$fieldC->id, $fieldA->id, $fieldB->id],
|
||||
]);
|
||||
|
||||
@@ -293,7 +293,7 @@ class RegistrationFormFieldTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/registration-fields/import-from-event", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/registration-fields/import-from-event", [
|
||||
'source_event_id' => $sourceEvent->id,
|
||||
]);
|
||||
|
||||
@@ -315,7 +315,7 @@ class RegistrationFormFieldTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/registration-fields/import-from-event", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/registration-fields/import-from-event", [
|
||||
'source_event_id' => $otherEvent->id,
|
||||
]);
|
||||
|
||||
@@ -331,7 +331,7 @@ class RegistrationFormFieldTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/registration-fields/from-template", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/registration-fields/from-template", [
|
||||
'template_id' => $template->id,
|
||||
]);
|
||||
|
||||
@@ -349,14 +349,14 @@ class RegistrationFormFieldTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/registration-fields");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/registration-fields");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
|
||||
public function test_unauthenticated_returns_401(): void
|
||||
{
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/registration-fields");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/registration-fields");
|
||||
|
||||
$response->assertUnauthorized();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ final class InputValidationSecurityTest extends TestCase
|
||||
|
||||
$xssPayload = '<script>alert("xss")</script>';
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons", [
|
||||
'crowd_type_id' => $this->crowdType->id,
|
||||
'first_name' => $xssPayload,
|
||||
'last_name' => 'Normal',
|
||||
@@ -95,7 +95,7 @@ final class InputValidationSecurityTest extends TestCase
|
||||
|
||||
$xssPayload = '<svg onload=alert(1)>';
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/sections", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections", [
|
||||
'name' => $xssPayload,
|
||||
]);
|
||||
|
||||
@@ -109,7 +109,7 @@ final class InputValidationSecurityTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->admin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons", [
|
||||
'crowd_type_id' => $this->crowdType->id,
|
||||
'first_name' => str_repeat('A', 256),
|
||||
'last_name' => 'Normal',
|
||||
@@ -139,7 +139,7 @@ final class InputValidationSecurityTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->admin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons", [
|
||||
'crowd_type_id' => $this->crowdType->id,
|
||||
'first_name' => 'Test',
|
||||
'last_name' => 'User',
|
||||
@@ -173,7 +173,7 @@ final class InputValidationSecurityTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->admin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons", [
|
||||
'crowd_type_id' => $this->crowdType->id,
|
||||
'first_name' => 'Test',
|
||||
'last_name' => 'User',
|
||||
@@ -210,7 +210,7 @@ final class InputValidationSecurityTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->admin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons", [
|
||||
'crowd_type_id' => $otherCrowdType->id,
|
||||
'first_name' => 'FK',
|
||||
'last_name' => 'Test',
|
||||
@@ -228,7 +228,7 @@ final class InputValidationSecurityTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->admin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons", [
|
||||
'crowd_type_id' => $this->crowdType->id,
|
||||
'first_name' => 'Company',
|
||||
'last_name' => 'Test',
|
||||
@@ -250,7 +250,7 @@ final class InputValidationSecurityTest extends TestCase
|
||||
Sanctum::actingAs($this->admin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$section->id}/shifts",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$section->id}/shifts",
|
||||
[
|
||||
'time_slot_id' => $timeSlot->id,
|
||||
'location_id' => $otherLocation->id,
|
||||
@@ -303,7 +303,7 @@ final class InputValidationSecurityTest extends TestCase
|
||||
Sanctum::actingAs($this->admin);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->event->id}/sections/{$section->id}/shifts/{$shift->id}/assign",
|
||||
"/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$section->id}/shifts/{$shift->id}/assign",
|
||||
['person_id' => $otherPerson->id]
|
||||
);
|
||||
|
||||
@@ -317,7 +317,7 @@ final class InputValidationSecurityTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->admin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons", [
|
||||
'crowd_type_id' => 'not-a-valid-ulid',
|
||||
'first_name' => 'Test',
|
||||
'last_name' => 'User',
|
||||
@@ -332,7 +332,7 @@ final class InputValidationSecurityTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->admin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons", [
|
||||
'crowd_type_id' => '01JZZZZZZZZZZZZZZZZZZZZZZ',
|
||||
'first_name' => 'Test',
|
||||
'last_name' => 'User',
|
||||
@@ -351,7 +351,7 @@ final class InputValidationSecurityTest extends TestCase
|
||||
|
||||
$sqlPayload = "'; DROP TABLE users; --";
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/persons", [
|
||||
'crowd_type_id' => $this->crowdType->id,
|
||||
'first_name' => $sqlPayload,
|
||||
'last_name' => 'Normal',
|
||||
|
||||
@@ -89,7 +89,7 @@ final class MultiTenancyIsolationTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->adminA);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->eventA->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->orgA->id}/events/{$this->eventA->id}/persons", [
|
||||
'crowd_type_id' => $this->crowdTypeB->id,
|
||||
'first_name' => 'Test',
|
||||
'last_name' => 'User',
|
||||
@@ -117,7 +117,7 @@ final class MultiTenancyIsolationTest extends TestCase
|
||||
]);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->eventA->id}/sections/{$sectionA->id}/shifts/{$shiftA->id}/assign",
|
||||
"/api/v1/organisations/{$this->orgA->id}/events/{$this->eventA->id}/sections/{$sectionA->id}/shifts/{$shiftA->id}/assign",
|
||||
['person_id' => $personB->id]
|
||||
);
|
||||
|
||||
@@ -142,7 +142,7 @@ final class MultiTenancyIsolationTest extends TestCase
|
||||
]);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->eventA->id}/crowd-lists/{$crowdListA->id}/persons",
|
||||
"/api/v1/organisations/{$this->orgA->id}/events/{$this->eventA->id}/crowd-lists/{$crowdListA->id}/persons",
|
||||
['person_id' => $personB->id]
|
||||
);
|
||||
|
||||
@@ -173,7 +173,7 @@ final class MultiTenancyIsolationTest extends TestCase
|
||||
]);
|
||||
|
||||
$response = $this->postJson(
|
||||
"/api/v1/events/{$this->eventA->id}/shift-assignments/bulk-approve",
|
||||
"/api/v1/organisations/{$this->orgA->id}/events/{$this->eventA->id}/shift-assignments/bulk-approve",
|
||||
['assignment_ids' => [$assignmentB->id]]
|
||||
);
|
||||
|
||||
@@ -207,7 +207,7 @@ final class MultiTenancyIsolationTest extends TestCase
|
||||
|
||||
$companyB = Company::factory()->create(['organisation_id' => $this->orgB->id]);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->eventA->id}/persons", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->orgA->id}/events/{$this->eventA->id}/persons", [
|
||||
'crowd_type_id' => $this->crowdTypeA->id,
|
||||
'first_name' => 'Test',
|
||||
'last_name' => 'User',
|
||||
@@ -225,7 +225,7 @@ final class MultiTenancyIsolationTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->adminA);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->eventA->id}/crowd-lists", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->orgA->id}/events/{$this->eventA->id}/crowd-lists", [
|
||||
'crowd_type_id' => $this->crowdTypeB->id,
|
||||
'name' => 'Test List',
|
||||
'type' => 'accreditation',
|
||||
@@ -266,7 +266,7 @@ final class MultiTenancyIsolationTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->adminA);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->eventA->id}/persons");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->orgA->id}/events/{$this->eventA->id}/persons");
|
||||
|
||||
$response->assertOk();
|
||||
$personIds = collect($response->json('data'))->pluck('id');
|
||||
@@ -280,7 +280,7 @@ final class MultiTenancyIsolationTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->adminB);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->eventA->id}/locations");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->orgA->id}/events/{$this->eventA->id}/locations");
|
||||
|
||||
// Event-scoped routes: policy returns 403 (user not in org) — access is blocked
|
||||
$response->assertForbidden();
|
||||
@@ -292,7 +292,7 @@ final class MultiTenancyIsolationTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->adminB);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->eventA->id}/sections");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->orgA->id}/events/{$this->eventA->id}/sections");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
@@ -305,7 +305,7 @@ final class MultiTenancyIsolationTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->adminB);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->eventA->id}/sections/{$sectionA->id}/shifts");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->orgA->id}/events/{$this->eventA->id}/sections/{$sectionA->id}/shifts");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
@@ -316,7 +316,7 @@ final class MultiTenancyIsolationTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->adminB);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->eventA->id}/time-slots");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->orgA->id}/events/{$this->eventA->id}/time-slots");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
@@ -327,7 +327,7 @@ final class MultiTenancyIsolationTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->adminB);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->eventA->id}/registration-fields");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->orgA->id}/events/{$this->eventA->id}/registration-fields");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
@@ -338,7 +338,7 @@ final class MultiTenancyIsolationTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->adminB);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->eventA->id}/shift-assignments");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->orgA->id}/events/{$this->eventA->id}/shift-assignments");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
@@ -355,7 +355,7 @@ final class MultiTenancyIsolationTest extends TestCase
|
||||
]);
|
||||
|
||||
$response = $this->putJson(
|
||||
"/api/v1/events/{$this->eventA->id}/persons/{$personA->id}",
|
||||
"/api/v1/organisations/{$this->orgA->id}/events/{$this->eventA->id}/persons/{$personA->id}",
|
||||
['first_name' => 'Hacked']
|
||||
);
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class ShiftTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts");
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertCount(3, $response->json('data'));
|
||||
@@ -75,7 +75,7 @@ class ShiftTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts", [
|
||||
'time_slot_id' => $this->timeSlot->id,
|
||||
'title' => 'Tapper',
|
||||
'slots_total' => 4,
|
||||
@@ -101,7 +101,7 @@ class ShiftTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}", [
|
||||
'title' => 'Barhoofd',
|
||||
'slots_total' => 1,
|
||||
]);
|
||||
@@ -119,7 +119,7 @@ class ShiftTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->deleteJson("/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}");
|
||||
$response = $this->deleteJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}");
|
||||
|
||||
$response->assertNoContent();
|
||||
$this->assertSoftDeleted('shifts', ['id' => $shift->id]);
|
||||
@@ -129,7 +129,7 @@ class ShiftTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts", [
|
||||
'title' => 'Tapper',
|
||||
'slots_total' => 4,
|
||||
'slots_open_for_claiming' => 0,
|
||||
@@ -148,7 +148,7 @@ class ShiftTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}", [
|
||||
'title' => 'Hacked',
|
||||
]);
|
||||
|
||||
@@ -164,7 +164,7 @@ class ShiftTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->deleteJson("/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}");
|
||||
$response = $this->deleteJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
@@ -185,7 +185,7 @@ class ShiftTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/assign", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/assign", [
|
||||
'person_id' => $person->id,
|
||||
]);
|
||||
|
||||
@@ -235,7 +235,7 @@ class ShiftTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift2->id}/assign", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift2->id}/assign", [
|
||||
'person_id' => $person->id,
|
||||
]);
|
||||
|
||||
@@ -277,7 +277,7 @@ class ShiftTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift2->id}/assign", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift2->id}/assign", [
|
||||
'person_id' => $person->id,
|
||||
]);
|
||||
|
||||
@@ -313,7 +313,7 @@ class ShiftTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/assign", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/assign", [
|
||||
'person_id' => $person2->id,
|
||||
]);
|
||||
|
||||
@@ -342,7 +342,7 @@ class ShiftTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/claim", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts/{$shift->id}/claim", [
|
||||
'person_id' => $person->id,
|
||||
]);
|
||||
|
||||
@@ -351,7 +351,7 @@ class ShiftTest extends TestCase
|
||||
|
||||
public function test_unauthenticated_returns_401(): void
|
||||
{
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts");
|
||||
|
||||
$response->assertUnauthorized();
|
||||
}
|
||||
@@ -360,7 +360,7 @@ class ShiftTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/sections/{$this->section->id}/shifts");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/sections/{$this->section->id}/shifts");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ class TimeSlotTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/time-slots");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/time-slots");
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertCount(3, $response->json('data'));
|
||||
@@ -98,7 +98,7 @@ class TimeSlotTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/time-slots");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/time-slots");
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
@@ -113,7 +113,7 @@ class TimeSlotTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/time-slots", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/time-slots", [
|
||||
'name' => 'Vrijdag Avond',
|
||||
'person_type' => 'VOLUNTEER',
|
||||
'date' => '2026-07-10',
|
||||
@@ -138,7 +138,7 @@ class TimeSlotTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/time-slots", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/time-slots", [
|
||||
'name' => 'Test',
|
||||
'person_type' => 'INVALID',
|
||||
'date' => '2026-07-10',
|
||||
@@ -154,7 +154,7 @@ class TimeSlotTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->postJson("/api/v1/events/{$this->event->id}/time-slots", [
|
||||
$response = $this->postJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/time-slots", [
|
||||
'name' => 'Test',
|
||||
'person_type' => 'VOLUNTEER',
|
||||
'date' => 'not-a-date',
|
||||
@@ -175,7 +175,7 @@ class TimeSlotTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/time-slots/{$timeSlot->id}", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/time-slots/{$timeSlot->id}", [
|
||||
'name' => 'Vrijdag Avond Updated',
|
||||
]);
|
||||
|
||||
@@ -189,7 +189,7 @@ class TimeSlotTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->putJson("/api/v1/events/{$this->event->id}/time-slots/{$timeSlot->id}", [
|
||||
$response = $this->putJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/time-slots/{$timeSlot->id}", [
|
||||
'name' => 'Hacked',
|
||||
]);
|
||||
|
||||
@@ -202,7 +202,7 @@ class TimeSlotTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->deleteJson("/api/v1/events/{$this->event->id}/time-slots/{$timeSlot->id}");
|
||||
$response = $this->deleteJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/time-slots/{$timeSlot->id}");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
@@ -213,7 +213,7 @@ class TimeSlotTest extends TestCase
|
||||
|
||||
Sanctum::actingAs($this->orgAdmin);
|
||||
|
||||
$response = $this->deleteJson("/api/v1/events/{$this->event->id}/time-slots/{$timeSlot->id}");
|
||||
$response = $this->deleteJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/time-slots/{$timeSlot->id}");
|
||||
|
||||
$response->assertNoContent();
|
||||
$this->assertDatabaseMissing('time_slots', ['id' => $timeSlot->id]);
|
||||
@@ -221,7 +221,7 @@ class TimeSlotTest extends TestCase
|
||||
|
||||
public function test_unauthenticated_returns_401(): void
|
||||
{
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/time-slots");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/time-slots");
|
||||
|
||||
$response->assertUnauthorized();
|
||||
}
|
||||
@@ -230,7 +230,7 @@ class TimeSlotTest extends TestCase
|
||||
{
|
||||
Sanctum::actingAs($this->outsider);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$this->event->id}/time-slots");
|
||||
$response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/events/{$this->event->id}/time-slots");
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user