feat(catalog): add is_enabled attribute to categories and filter items accordingly

This commit is contained in:
2026-08-24 10:49:14 -03:00
parent 87a4fa6288
commit 2eeef8d392
5 changed files with 100 additions and 0 deletions

View File

@@ -49,6 +49,15 @@ class FeaturedGroupService
{
$query = CatalogItem::query()
->where('catalog_items.tenant_code', $featuredGroup->tenant_code)
->where(function (Builder $query): void {
$query
->whereDoesntHave('category')
->orWhereHas(
'category',
fn (Builder $categoryQuery): Builder => $categoryQuery
->where('is_enabled', true),
);
})
->with([
'inventory',
'attachments',