feat: implement index methods for Accommodation, Entry, Food, and Merchandise controllers; add service methods for fetching current items
This commit is contained in:
@@ -20,6 +20,20 @@ class AccommodationService
|
||||
{
|
||||
private const ATTRIBUTE_CODE = 'tipo_alojamiento';
|
||||
|
||||
public function current(Tenant $tenant): CatalogItem
|
||||
{
|
||||
return CatalogItem::query()
|
||||
->where('tenant_code', $tenant->codigo)
|
||||
->where('slug', 'alojamiento')
|
||||
->with([
|
||||
'itemAttributes.attribute.options',
|
||||
'variants.catalogItem',
|
||||
'variants.inventory',
|
||||
'variants.definitions',
|
||||
])
|
||||
->firstOrFail();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int, array<string, mixed>> $variants
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user