Add tenant lifecycle view and limit controls
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-01 19:36:51 +01:00
parent 117250879b
commit da06db2d3b
22 changed files with 1312 additions and 148 deletions

View File

@@ -23,8 +23,8 @@ use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Illuminate\Validation\ValidationException;
use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
class PhotoController extends Controller
{
@@ -265,20 +265,6 @@ class PhotoController extends Controller
? $this->packageLimitEvaluator->resolveEventPackageForPhotoUpload($tenant, $event->id, $event)
: null;
if ($tenant) {
$violation = $this->packageLimitEvaluator->assessPhotoUpload($tenant, $event->id, $event);
if ($violation !== null) {
return ApiError::response(
$violation['code'],
$violation['title'],
$violation['message'],
$violation['status'],
$violation['meta']
);
}
}
$previousUsedPhotos = $eventPackage?->used_photos ?? 0;
$validated = $request->validated();
@@ -304,6 +290,25 @@ class PhotoController extends Controller
]);
}
if ($tenant) {
$violation = $this->packageLimitEvaluator->assessPhotoUpload(
$tenant,
$event->id,
$event,
$file->getSize()
);
if ($violation !== null) {
return ApiError::response(
$violation['code'],
$violation['title'],
$violation['message'],
$violation['status'],
$violation['meta']
);
}
}
// Determine storage target
$disk = $this->eventStorageManager->getHotDiskForEvent($event);