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

@@ -33,7 +33,6 @@ class CatalogSchemaTest extends TestCase
$this->assertEqualsCanonicalizing([
'id',
'tenant_code',
'event_product_type',
'category_id',
'brand_id',
'inventory_id',

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');

View File

@@ -4,7 +4,6 @@ namespace Tests\Unit\Catalog;
use App\Domains\Attachable\Models\Attachment;
use App\Domains\Catalog\Enums\CatalogItemType;
use App\Domains\Catalog\Enums\EventProductType;
use App\Domains\Catalog\Enums\FeaturedGroupSource;
use App\Domains\Catalog\Enums\GroupLayout;
use App\Domains\Catalog\Enums\InventoryPolicy;
@@ -76,7 +75,6 @@ class CatalogModelsTest extends TestCase
'category_id' => '10',
'brand_id' => '20',
'inventory_id' => '30',
'event_product_type' => EventProductType::Entry->value,
'type' => CatalogItemType::Standard->value,
'precio' => '12.50',
'inventory_policy' => InventoryPolicy::Tracked->value,
@@ -88,7 +86,6 @@ class CatalogModelsTest extends TestCase
$this->assertSame(10, $item->category_id);
$this->assertSame(20, $item->brand_id);
$this->assertSame(30, $item->inventory_id);
$this->assertSame(EventProductType::Entry, $item->event_product_type);
$this->assertSame(CatalogItemType::Standard, $item->type);
$this->assertSame('12.50', $item->precio);
$this->assertSame(InventoryPolicy::Tracked, $item->inventory_policy);