feat(seeders): associate categories with tenant codes in seeders and tests

This commit is contained in:
2026-07-28 10:42:55 -03:00
parent ff9d7728e8
commit 89f6dab0c4
5 changed files with 52 additions and 7 deletions

View File

@@ -236,11 +236,11 @@ class ProductCatalogFromImagesSeeder extends Seeder
$category = Category::query()
->where('nombre', $metadata['category_name'])
->whereNull('tenant_code')
->where('tenant_code', $tenant->codigo)
->first();
if (! $category instanceof Category) {
throw new RuntimeException("Category '{$metadata['category_name']}' not found.");
throw new RuntimeException("Category '{$metadata['category_name']}' not found for tenant '{$tenant->codigo}'.");
}
$attributeCodes = Attribute::query()