feat(catalog): add show_in_selector attribute to item attributes and update related logic

This commit is contained in:
2026-08-12 16:11:53 -03:00
parent 8359f0831f
commit 7c7a295625
12 changed files with 115 additions and 1 deletions

View File

@@ -93,6 +93,26 @@ class CatalogServiceTest extends TestCase
}
}
public function test_it_can_hide_an_item_attribute_from_the_product_selector(): void
{
$attribute = $this->createAttribute('internal_type');
$item = $this->service->create([
'tenant_code' => $this->tenant->codigo,
'slug' => 'hidden-attribute-item',
'nombre' => 'Hidden attribute item',
'precio' => 100,
'attribute_codes' => [$attribute->codigo],
'hidden_attribute_codes' => [$attribute->codigo],
'variants' => [[
'real_stock' => 5,
'values' => [$attribute->codigo => 'internal'],
]],
]);
$this->assertFalse($item->itemAttributes->sole()->show_in_selector);
}
public function test_it_allows_the_same_event_date_with_different_attribute_values(): void
{
$sector = $this->createAttribute('sector');