updated table structure for photobooth/sparkbooth settings. now there's a separate table for it. update all references and tests. also fixed the notification panel and the lightbox in the guest app.

This commit is contained in:
Codex Agent
2025-12-18 08:49:56 +01:00
parent ece38fc009
commit 1c4acda332
30 changed files with 734 additions and 538 deletions

View File

@@ -2,7 +2,7 @@
namespace App\Console\Commands;
use App\Models\Event;
use App\Models\EventPhotoboothSetting;
use App\Services\Photobooth\PhotoboothProvisioner;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;
@@ -17,12 +17,20 @@ class DeactivateExpiredPhotoboothAccounts extends Command
{
$total = 0;
Event::query()
->where('photobooth_enabled', true)
->whereNotNull('photobooth_expires_at')
->where('photobooth_expires_at', '<=', now())
->chunkById(50, function ($events) use (&$total, $provisioner) {
foreach ($events as $event) {
EventPhotoboothSetting::query()
->where('enabled', true)
->where('mode', 'ftp')
->whereNotNull('expires_at')
->where('expires_at', '<=', now())
->with('event')
->chunkById(50, function ($settings) use (&$total, $provisioner) {
foreach ($settings as $setting) {
$event = $setting->event;
if (! $event) {
continue;
}
try {
$provisioner->disable($event);
$total++;

View File

@@ -2,7 +2,7 @@
namespace App\Console\Commands;
use App\Models\Event;
use App\Models\EventPhotoboothSetting;
use App\Services\Photobooth\PhotoboothIngestService;
use Illuminate\Console\Command;
@@ -20,16 +20,23 @@ class PhotoboothIngestCommand extends Command
$processedTotal = 0;
$skippedTotal = 0;
$query = Event::query()
->where('photobooth_enabled', true)
->whereNotNull('photobooth_path');
$query = EventPhotoboothSetting::query()
->where('enabled', true)
->whereNotNull('path')
->with('event');
if ($eventId) {
$query->whereKey($eventId);
$query->where('event_id', $eventId);
}
$query->chunkById(25, function ($events) use ($ingestService, $maxFiles, &$processedTotal, &$skippedTotal) {
foreach ($events as $event) {
$query->chunkById(25, function ($settings) use ($ingestService, $maxFiles, &$processedTotal, &$skippedTotal) {
foreach ($settings as $setting) {
$event = $setting->event;
if (! $event) {
continue;
}
$summary = $ingestService->ingest($event, $maxFiles ? (int) $maxFiles : null);
$processedTotal += $summary['processed'] ?? 0;
$skippedTotal += $summary['skipped'] ?? 0;