feat(events): add event categories and filtering

This commit is contained in:
2026-09-21 09:16:28 -03:00
parent b0702b7e15
commit 79d402e210
13 changed files with 134 additions and 8 deletions

View File

@@ -113,6 +113,10 @@ class TenantSeeder extends Seeder
$onTicketTenant = Tenant::query()->where('codigo', 'onticket')->firstOrFail();
foreach (['Música', 'Teatro', 'Deportes', 'Infantiles', 'Otros'] as $nombre) {
$onTicketTenant->eventCategories()->firstOrCreate(['nombre' => $nombre]);
}
if ($onTicketTenant->storefront_website_type_code === 'onticket_multi_event' && ! $onTicketTenant->display_seach_bar) {
$onTicketTenant->update(['display_seach_bar' => true]);
}

View File

@@ -20,6 +20,7 @@ class TestEventsSeeder extends Seeder
$events = [
[
'title' => '[Prueba] Noche de Música en Vivo',
'category' => 'Música',
'subtitle' => 'Una noche para cantar y bailar',
'description' => 'Evento de prueba para explorar la cartelera de OnTicket.',
'location' => 'Teatro Broadway, Rosario',
@@ -30,6 +31,7 @@ class TestEventsSeeder extends Seeder
],
[
'title' => '[Prueba] Festival de Sabores',
'category' => 'Otros',
'subtitle' => 'Gastronomía y música para toda la familia',
'description' => 'Evento de prueba con dos jornadas disponibles.',
'location' => 'Parque de España, Rosario',
@@ -41,6 +43,7 @@ class TestEventsSeeder extends Seeder
],
[
'title' => '[Prueba] Stand Up en el Centro',
'category' => 'Teatro',
'subtitle' => 'Humor para compartir',
'description' => 'Evento de prueba para visualizar distintas propuestas.',
'location' => 'Centro Cultural La Comedia, Rosario',
@@ -60,9 +63,16 @@ class TestEventsSeeder extends Seeder
'description' => $definition['description'],
'location' => $definition['location'],
'published_at' => now(),
'event_category_id' => $tenant->eventCategories()
->where('nombre', $definition['category'])->value('id'),
],
);
if ($event->event_category_id === null) {
$event->update(['event_category_id' => $tenant->eventCategories()
->where('nombre', $definition['category'])->value('id')]);
}
if ($event->attachment_id === null) {
$path = public_path('images/tennants/onticket/test-events/'.$definition['image']);