feat(catalog): add scope to filter available variants and update related queries; enhance seeder and tests for stock validation

This commit is contained in:
2026-08-11 09:10:26 -03:00
parent 6f63a87af5
commit 19b506a465
8 changed files with 70 additions and 8 deletions

View File

@@ -207,6 +207,7 @@ class CatalogService
$paginator = CatalogItem::query()
->where('tenant_code', $tenant->codigo)
->whereVariantsAvailable()
->where(function (Builder $query) use ($containsPattern): void {
$query
->whereRaw('LOWER(nombre) LIKE ?', [$containsPattern])
@@ -257,6 +258,7 @@ class CatalogService
return CatalogItem::query()
->where('tenant_code', $tenant->codigo)
->where('category_id', $category->id)
->whereVariantsAvailable()
->with([
'attachments',
'inventory',