feat: implement AI styling foundation and billing scope rework
This commit is contained in:
@@ -16,6 +16,9 @@ use App\Models\GuestNotification;
|
||||
use App\Models\GuestPolicySetting;
|
||||
use App\Models\Photo;
|
||||
use App\Models\PhotoShareLink;
|
||||
use App\Services\AiEditing\AiEditingRuntimeConfig;
|
||||
use App\Services\AiEditing\AiStylingEntitlementService;
|
||||
use App\Services\AiEditing\EventAiEditingPolicyService;
|
||||
use App\Services\Analytics\JoinTokenAnalyticsRecorder;
|
||||
use App\Services\EventJoinTokenService;
|
||||
use App\Services\EventTasksCacheService;
|
||||
@@ -61,6 +64,9 @@ class EventPublicController extends BaseController
|
||||
private readonly EventTasksCacheService $eventTasksCache,
|
||||
private readonly GuestNotificationService $guestNotificationService,
|
||||
private readonly PushSubscriptionService $pushSubscriptions,
|
||||
private readonly AiEditingRuntimeConfig $aiEditingRuntimeConfig,
|
||||
private readonly AiStylingEntitlementService $aiStylingEntitlements,
|
||||
private readonly EventAiEditingPolicyService $eventAiEditingPolicy,
|
||||
) {}
|
||||
|
||||
/**
|
||||
@@ -1953,6 +1959,11 @@ class EventPublicController extends BaseController
|
||||
$engagementMode = $settings['engagement_mode'] ?? 'tasks';
|
||||
$liveShowSettings = Arr::get($settings, 'live_show', []);
|
||||
$liveShowSettings = is_array($liveShowSettings) ? $liveShowSettings : [];
|
||||
$aiStylingEntitlement = $this->aiStylingEntitlements->resolveForEvent($event);
|
||||
$aiEditingPolicy = $this->eventAiEditingPolicy->resolve($event);
|
||||
$aiStylingAvailable = $this->aiEditingRuntimeConfig->isEnabled()
|
||||
&& (bool) $aiStylingEntitlement['allowed']
|
||||
&& (bool) $aiEditingPolicy['enabled'];
|
||||
$event->loadMissing('photoboothSetting');
|
||||
$policy = $this->guestPolicy();
|
||||
|
||||
@@ -1980,6 +1991,13 @@ class EventPublicController extends BaseController
|
||||
'live_show' => [
|
||||
'moderation_mode' => $liveShowSettings['moderation_mode'] ?? 'manual',
|
||||
],
|
||||
'capabilities' => [
|
||||
'ai_styling' => $aiStylingAvailable,
|
||||
'ai_styling_granted_by' => $aiStylingEntitlement['granted_by'],
|
||||
'ai_styling_required_feature' => $aiStylingEntitlement['required_feature'],
|
||||
'ai_styling_addon_keys' => $aiStylingEntitlement['addon_keys'],
|
||||
'ai_styling_event_enabled' => (bool) $aiEditingPolicy['enabled'],
|
||||
],
|
||||
'engagement_mode' => $engagementMode,
|
||||
])->header('Cache-Control', 'no-store');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user