feat(entry): enhance variant filtering in all method to exclude replaced and disabled variants
This commit is contained in:
@@ -24,8 +24,13 @@ class EntryService
|
||||
return CatalogItem::query()
|
||||
->where('tenant_code', $tenant->codigo)
|
||||
->whereHas('category', fn ($query) => $query->where('nombre', 'Entradas'))
|
||||
->whereHas('variants', fn ($query) => $query
|
||||
->whereNull('replaced_by_variant_id')
|
||||
->whereNull('sales_disabled_at'))
|
||||
->with([
|
||||
'variants' => fn ($query) => $query->whereNull('replaced_by_variant_id'),
|
||||
'variants' => fn ($query) => $query
|
||||
->whereNull('replaced_by_variant_id')
|
||||
->whereNull('sales_disabled_at'),
|
||||
'variants.inventory',
|
||||
'variants.eventDate',
|
||||
'variants.eventDates',
|
||||
|
||||
Reference in New Issue
Block a user