feat: implement delete functionality for accommodations, entries, foods, and merchandise; enhance related services and tests

This commit is contained in:
2026-08-10 11:33:05 -03:00
parent 4aaa66dc38
commit 2693df2cbf
14 changed files with 263 additions and 0 deletions

View File

@@ -76,6 +76,18 @@ class EntryService
});
}
public function delete(Tenant $tenant, int $entryId): void
{
$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();
$this->catalogService->delete($entry);
}
/** @param array<string, mixed> $entry */
private function update(Tenant $tenant, Category $category, array $entry, int $index): CatalogItem
{