feat(addons): finalize event addon catalog and ai styling upgrade flow
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-02-07 12:35:07 +01:00
parent 8cc0918881
commit d2808ffa4f
36 changed files with 1372 additions and 457 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Http\Resources\Tenant;
use App\Models\WatermarkSetting;
use App\Services\Addons\EventAddonCatalog;
use App\Services\AiEditing\AiStylingEntitlementService;
use App\Services\AiEditing\EventAiEditingPolicyService;
use App\Services\Packages\PackageLimitEvaluator;
@@ -222,11 +223,17 @@ class EventResource extends JsonResource
? $eventPackage->addons
: $eventPackage->addons()->latest()->take(10)->get();
return $addons->map(function ($addon) {
$addonLabels = collect(app(EventAddonCatalog::class)->all())
->mapWithKeys(fn (array $addon, string $key): array => [$key => $addon['label'] ?? null])
->all();
return $addons->map(function ($addon) use ($addonLabels) {
return [
'id' => $addon->id,
'key' => $addon->addon_key,
'label' => $addon->metadata['label'] ?? null,
'label' => $addon->metadata['label']
?? ($addonLabels[$addon->addon_key] ?? null)
?? $addon->addon_key,
'status' => $addon->status,
'variant_id' => $addon->variant_id,
'transaction_id' => $addon->transaction_id,