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

@@ -276,6 +276,26 @@ class CatalogItemDetailControllerTest extends TestCase
);
}
public function test_it_exposes_whether_an_item_attribute_should_be_shown_in_the_selector(): void
{
$tenant = $this->createTenant('detail-hidden-attribute');
$item = $this->createItem($tenant, 'Hidden attribute');
$attribute = Attribute::query()->create([
'tenant_codigo' => $tenant->codigo,
'codigo' => 'internal_type',
'nombre' => 'Internal type',
'type' => FieldType::String,
]);
$item->itemAttributes()->create([
'attribute_id' => $attribute->id,
'show_in_selector' => false,
]);
$this->getJson("/api/tenants/{$tenant->codigo}/catalog-items/{$item->id}")
->assertOk()
->assertJsonPath('data.attributes.0.show_in_selector', false);
}
private function createItem(
Tenant $tenant,
string $name,