feat: remove EventProductType references and related logic from catalog and fiesta futbol infantil components

This commit is contained in:
2026-08-10 16:37:28 -03:00
parent 5bfc8b9f70
commit 69320c54d4
21 changed files with 90 additions and 79 deletions

View File

@@ -100,7 +100,6 @@ class EntryControllerTest extends TestCase
CatalogItem::query()->each(function (CatalogItem $entry) use ($tenant, $entryCategory): void {
$this->assertSame($tenant->codigo, $entry->tenant_code);
$this->assertSame($entryCategory->id, $entry->category_id);
$this->assertSame('entrada', $entry->event_product_type->value);
$this->assertSame('tracked', $entry->inventory_policy->value);
$this->assertTrue($entry->has_tickets);
$this->assertNull($entry->inventory_id);
@@ -224,6 +223,46 @@ class EntryControllerTest extends TestCase
$this->assertDatabaseCount('catalog_items', 0);
}
public function test_entries_are_identified_by_the_entries_category(): void
{
$tenant = $this->createFiestaTenant();
$this->createEventDateAttribute($tenant);
$eventDate = $tenant->eventDates()->create([
'date' => '2026-10-09',
'time_start' => '00:00',
'time_end' => '23:59',
]);
$merchandisingCategory = Category::query()->create([
'tenant_code' => $tenant->codigo,
'nombre' => 'Merchandising',
]);
$merchandise = CatalogItem::query()->create([
'tenant_code' => $tenant->codigo,
'category_id' => $merchandisingCategory->id,
'slug' => 'camiseta',
'nombre' => 'Camiseta',
'precio' => 100,
]);
Sanctum::actingAs($this->createAdminAppUser($tenant));
$this->getJson('/api/v1/adminapp/tenant/entries')
->assertOk()
->assertJsonCount(0, 'data');
$this->postJson('/api/v1/adminapp/tenant/entries', [
'entries' => [[
'id' => $merchandise->id,
'title' => 'Entrada inválida',
'description' => null,
'event_date_ids' => [$eventDate->id],
'stock' => 10,
'price' => 100,
]],
])
->assertUnprocessable()
->assertJsonValidationErrors(['entries.0.id']);
}
public function test_the_endpoint_is_only_available_for_fiesta_futbol_infantil(): void
{
$tenant = $this->createTenant('other');