feat: implement index methods for Accommodation, Entry, Food, and Merchandise controllers; add service methods for fetching current items

This commit is contained in:
2026-08-10 10:04:57 -03:00
parent 00489c14d3
commit ca605127d0
13 changed files with 136 additions and 0 deletions

View File

@@ -19,6 +19,21 @@ class EntryService
{
public function __construct(private readonly CatalogService $catalogService) {}
/** @return Collection<int, CatalogItem> */
public function all(Tenant $tenant): Collection
{
return CatalogItem::query()
->where('tenant_code', $tenant->codigo)
->where('event_product_type', EventProductType::Entry->value)
->with([
'variants.inventory',
'variants.eventDate',
'variants.eventDates',
])
->orderBy('id')
->get();
}
/**
* @param array<int, array<string, mixed>> $entries
* @return Collection<int, CatalogItem>