feat: add guest notification insights

This commit is contained in:
Codex Agent
2025-11-12 19:31:13 +01:00
parent 642541c8fb
commit 2c412e3764
7 changed files with 440 additions and 7 deletions

View File

@@ -0,0 +1,39 @@
<?php
namespace Tests\Feature\Tenant;
use App\Enums\GuestNotificationType;
use App\Models\Event;
use App\Models\GuestNotification;
class EventToolkitNotificationsTest extends TenantTestCase
{
public function test_toolkit_response_contains_notification_summary(): void
{
$event = Event::factory()->for($this->tenant)->create([
'status' => 'published',
'slug' => 'toolkit-event',
]);
GuestNotification::factory()->create([
'tenant_id' => $this->tenant->id,
'event_id' => $event->id,
'type' => GuestNotificationType::BROADCAST,
'title' => 'Broadcast',
]);
GuestNotification::factory()->create([
'tenant_id' => $this->tenant->id,
'event_id' => $event->id,
'type' => GuestNotificationType::UPLOAD_ALERT,
'title' => 'Upload Hinweis',
]);
$response = $this->authenticatedRequest('GET', "/api/v1/tenant/events/{$event->slug}/toolkit");
$response->assertOk();
$response->assertJsonPath('notifications.summary.total', 2);
$response->assertJsonPath('notifications.summary.broadcasts.total', 1);
$response->assertJsonCount(2, 'notifications.recent');
}
}