implemented event package addons with filament resource, event-admin purchase path and notifications, showing up in purchase history

This commit is contained in:
Codex Agent
2025-11-21 11:25:45 +01:00
parent 07fe049b8a
commit 7a8d22a238
58 changed files with 3339 additions and 60 deletions

View File

@@ -0,0 +1,43 @@
<?php
namespace Tests\Unit\Services;
use App\Models\PackageAddon;
use App\Services\Addons\EventAddonCatalog;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Config;
use Tests\TestCase;
class EventAddonCatalogTest extends TestCase
{
use RefreshDatabase;
public function test_prefers_database_addons_over_config(): void
{
Config::set('package-addons', [
'extra_photos_small' => [
'label' => 'Config Photos',
'price_id' => 'pri_config',
'increments' => ['extra_photos' => 100],
],
]);
PackageAddon::create([
'key' => 'extra_photos_small',
'label' => 'DB Photos',
'price_id' => 'pri_db',
'extra_photos' => 200,
'active' => true,
'sort' => 1,
]);
$catalog = $this->app->make(EventAddonCatalog::class);
$addon = $catalog->find('extra_photos_small');
$this->assertNotNull($addon);
$this->assertSame('DB Photos', $addon['label']);
$this->assertSame('pri_db', $addon['price_id']);
$this->assertSame(200, $addon['increments']['extra_photos']);
}
}