refactor(event): move event configuration onto tenant
This commit is contained in:
@@ -14,7 +14,6 @@ use App\Domains\Catalog\Models\CatalogItem;
|
||||
use App\Domains\Catalog\Models\Category;
|
||||
use App\Domains\Catalog\Models\FeaturedGroup;
|
||||
use App\Domains\Catalog\Models\Inventory;
|
||||
use App\Domains\Event\Models\Event;
|
||||
use App\Domains\Event\Models\EventDate;
|
||||
use App\Domains\Tenant\Models\Tenant;
|
||||
use App\Domains\Ticket\Enums\ValidityTimeType;
|
||||
@@ -96,15 +95,11 @@ class FiestaFutbolInfantilProductSeederTest extends TestCase
|
||||
->all(),
|
||||
);
|
||||
|
||||
$event = Event::query()
|
||||
->where('tenant_code', $tenant->codigo)
|
||||
->with('dates')
|
||||
->sole();
|
||||
|
||||
$this->assertSame($event->id, $tenant->fresh()->active_event_id);
|
||||
$this->assertCount(4, $event->dates);
|
||||
$this->assertSame(1, Event::query()->where('tenant_code', $tenant->codigo)->count());
|
||||
$this->assertSame(4, EventDate::query()->where('event_id', $event->id)->count());
|
||||
$tenant->refresh()->load('eventDates');
|
||||
$this->assertSame('Fiesta Nacional del Fútbol Infantil', $tenant->event_title);
|
||||
$this->assertSame('Sunchales, Santa Fe', $tenant->event_location);
|
||||
$this->assertCount(4, $tenant->eventDates);
|
||||
$this->assertSame(4, EventDate::query()->where('tenant_code', $tenant->codigo)->count());
|
||||
|
||||
$generalAdmission = CatalogItem::query()
|
||||
->where('tenant_code', $tenant->codigo)
|
||||
@@ -113,7 +108,6 @@ class FiestaFutbolInfantilProductSeederTest extends TestCase
|
||||
->sole();
|
||||
|
||||
$this->assertNull($generalAdmission->inventory_id);
|
||||
$this->assertTrue($generalAdmission->event->is($event));
|
||||
$this->assertSame(EventProductType::Entry, $generalAdmission->event_product_type);
|
||||
$this->assertCount(0, $generalAdmission->itemAttributes);
|
||||
$this->assertCount(4, $generalAdmission->variants);
|
||||
@@ -133,7 +127,6 @@ class FiestaFutbolInfantilProductSeederTest extends TestCase
|
||||
|
||||
$this->assertCount(7, $standardItems);
|
||||
foreach ($standardItems as $standardItem) {
|
||||
$this->assertSame($event->id, $standardItem->event_id);
|
||||
$this->assertSame(
|
||||
'2026-10-09 00:00:00',
|
||||
$standardItem->validityTime->fixed_starts_at->format('Y-m-d H:i:s'),
|
||||
@@ -154,7 +147,6 @@ class FiestaFutbolInfantilProductSeederTest extends TestCase
|
||||
$this->assertSame('40000.00', $allDaysItem->precio);
|
||||
$this->assertNull($allDaysItem->inventory_id);
|
||||
$this->assertFalse($allDaysItem->has_tickets);
|
||||
$this->assertSame($event->id, $allDaysItem->event_id);
|
||||
$this->assertSame(EventProductType::Entry, $allDaysItem->event_product_type);
|
||||
$this->assertCount(4, $allDaysItem->bundleComponents);
|
||||
$this->assertEqualsCanonicalizing(
|
||||
|
||||
Reference in New Issue
Block a user