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

@@ -2,7 +2,6 @@
namespace App\Domains\FiestaFutbolInfantil\Services;
use App\Domains\Catalog\Enums\EventProductType;
use App\Domains\Catalog\Enums\InventoryPolicy;
use App\Domains\Catalog\Models\Attribute;
use App\Domains\Catalog\Models\AttributeOption;
@@ -135,7 +134,6 @@ class AccommodationService
if ($accommodation !== null) {
$accommodation->update([
'category_id' => $category->id,
'event_product_type' => EventProductType::Product->value,
'inventory_policy' => InventoryPolicy::Tracked->value,
'has_tickets' => true,
]);
@@ -150,7 +148,6 @@ class AccommodationService
'descripcion' => 'Alojamiento',
'category_id' => $category->id,
'precio' => collect($variants)->min('price') ?? 0,
'event_product_type' => EventProductType::Product->value,
'inventory_policy' => InventoryPolicy::Tracked->value,
'has_tickets' => true,
'inventory_id' => null,

View File

@@ -2,7 +2,6 @@
namespace App\Domains\FiestaFutbolInfantil\Services;
use App\Domains\Catalog\Enums\EventProductType;
use App\Domains\Catalog\Enums\InventoryPolicy;
use App\Domains\Catalog\Models\CatalogItem;
use App\Domains\Catalog\Models\Category;
@@ -24,7 +23,7 @@ class EntryService
{
return CatalogItem::query()
->where('tenant_code', $tenant->codigo)
->where('event_product_type', EventProductType::Entry->value)
->whereHas('category', fn ($query) => $query->where('nombre', 'Entradas'))
->with([
'variants.inventory',
'variants.eventDate',
@@ -62,7 +61,6 @@ class EntryService
'descripcion' => $entry['description'] ?? null,
'category_id' => $category->id,
'precio' => $entry['price'],
'event_product_type' => EventProductType::Entry->value,
'has_tickets' => true,
'inventory_policy' => InventoryPolicy::Tracked->value,
'attribute_codes' => ['event_date'],
@@ -81,7 +79,6 @@ class EntryService
$entry = CatalogItem::query()
->whereKey($entryId)
->where('tenant_code', $tenant->codigo)
->where('event_product_type', EventProductType::Entry->value)
->whereHas('category', fn ($query) => $query->where('nombre', 'Entradas'))
->firstOrFail();
@@ -94,7 +91,7 @@ class EntryService
$catalogItem = CatalogItem::query()
->whereKey($entry['id'])
->where('tenant_code', $tenant->codigo)
->where('event_product_type', EventProductType::Entry->value)
->whereHas('category', fn ($query) => $query->where('nombre', 'Entradas'))
->lockForUpdate()
->firstOrFail();

View File

@@ -2,7 +2,6 @@
namespace App\Domains\FiestaFutbolInfantil\Services;
use App\Domains\Catalog\Enums\EventProductType;
use App\Domains\Catalog\Enums\InventoryPolicy;
use App\Domains\Catalog\Models\Attribute;
use App\Domains\Catalog\Models\AttributeOption;
@@ -146,7 +145,6 @@ class FoodService
if ($food !== null) {
$food->update([
'category_id' => $category->id,
'event_product_type' => EventProductType::Product->value,
'inventory_policy' => InventoryPolicy::Tracked->value,
'has_tickets' => true,
]);
@@ -161,7 +159,6 @@ class FoodService
'descripcion' => 'Comida',
'category_id' => $category->id,
'precio' => collect($variants)->min('price') ?? 0,
'event_product_type' => EventProductType::Product->value,
'inventory_policy' => InventoryPolicy::Tracked->value,
'has_tickets' => true,
'inventory_id' => null,

View File

@@ -2,7 +2,6 @@
namespace App\Domains\FiestaFutbolInfantil\Services;
use App\Domains\Catalog\Enums\EventProductType;
use App\Domains\Catalog\Enums\InventoryPolicy;
use App\Domains\Catalog\Models\Attribute;
use App\Domains\Catalog\Models\AttributeOption;
@@ -29,7 +28,6 @@ class MerchandiseService
{
return CatalogItem::query()
->where('tenant_code', $tenant->codigo)
->where('event_product_type', EventProductType::Product->value)
->whereHas('category', fn ($query) => $query->where('nombre', 'Merchandising'))
->with([
'itemAttributes.attribute.options',
@@ -74,7 +72,6 @@ class MerchandiseService
'descripcion' => $data['description'] ?? null,
'category_id' => $category->id,
'max_units_per_user' => (int) $data['max_units_per_user'],
'event_product_type' => EventProductType::Product->value,
'inventory_policy' => InventoryPolicy::Tracked->value,
'has_tickets' => true,
]);
@@ -129,7 +126,6 @@ class MerchandiseService
->whereKey($merchandiseId)
->whereHas('catalogItem', fn ($query) => $query
->where('tenant_code', $tenant->codigo)
->where('event_product_type', EventProductType::Product->value)
->whereHas('category', fn ($categoryQuery) => $categoryQuery
->where('nombre', 'Merchandising')))
->firstOrFail();
@@ -170,7 +166,6 @@ class MerchandiseService
->whereKey($itemId)
->where('tenant_code', $tenant->codigo)
->where('category_id', $category->id)
->where('event_product_type', EventProductType::Product->value)
->lockForUpdate()
->first();
@@ -201,7 +196,6 @@ class MerchandiseService
'category_id' => $category->id,
'precio' => collect($data['variants'])->min('price') ?? 0,
'max_units_per_user' => (int) $data['max_units_per_user'],
'event_product_type' => EventProductType::Product->value,
'inventory_policy' => InventoryPolicy::Tracked->value,
'has_tickets' => true,
'inventory_id' => null,