Limit-Status im Upload-Flow anzeigen (Warnbanner + Sperrzustände).

Upload-Fehlercodes auswerten und freundliche Dialoge zeigen.
This commit is contained in:
Codex Agent
2025-11-01 19:50:17 +01:00
parent 2c14493604
commit 79b209de9a
55 changed files with 3348 additions and 462 deletions

View File

@@ -131,4 +131,40 @@ class EventGuestUploadLimitTest extends TestCase
$this->assertGreaterThanOrEqual(2, $thresholdJobs->count());
Bus::assertDispatched(SendEventPackagePhotoLimitNotification::class);
}
public function test_guest_package_endpoint_returns_limits_summary(): void
{
$tenant = Tenant::factory()->create();
$event = Event::factory()->for($tenant)->create([
'status' => 'published',
]);
$package = Package::factory()->endcustomer()->create([
'max_photos' => 10,
'max_guests' => 20,
'gallery_days' => 7,
]);
$eventPackage = EventPackage::create([
'event_id' => $event->id,
'package_id' => $package->id,
'purchased_price' => $package->price,
'purchased_at' => now()->subDay(),
'used_photos' => 8,
'used_guests' => 5,
'gallery_expires_at' => now()->addDays(3),
]);
$token = app(EventJoinTokenService::class)->createToken($event)->plain_token;
$response = $this->getJson("/api/v1/events/{$token}/package");
$response->assertOk();
$response->assertJsonPath('id', $eventPackage->id);
$response->assertJsonPath('limits.photos.limit', 10);
$response->assertJsonPath('limits.photos.used', 8);
$response->assertJsonPath('limits.photos.state', 'warning');
$response->assertJsonPath('limits.gallery.state', 'warning');
$response->assertJsonPath('limits.can_upload_photos', true);
}
}