refactor(catalog): add ticket_label to item attributes and update related logic

This commit is contained in:
2026-08-19 11:22:46 -03:00
parent 67e6211857
commit 16bc657a31
12 changed files with 114 additions and 11 deletions

View File

@@ -196,6 +196,26 @@ class CatalogServiceTest extends TestCase
$this->assertFalse($item->itemAttributes->sole()->show_in_selector);
}
public function test_it_can_configure_an_attribute_label_for_ticket_names(): void
{
$attribute = $this->createAttribute('sector');
$item = $this->service->create([
'tenant_code' => $this->tenant->codigo,
'slug' => 'ticket-labeled-attribute-item',
'nombre' => 'Ticket labeled attribute item',
'precio' => 100,
'attribute_codes' => [$attribute->codigo],
'ticket_attribute_labels' => [$attribute->codigo => 'Lado'],
'variants' => [[
'real_stock' => 5,
'values' => [$attribute->codigo => 'A'],
]],
]);
$this->assertSame('Lado', $item->itemAttributes->sole()->ticket_label);
}
public function test_it_allows_the_same_event_date_with_different_attribute_values(): void
{
$sector = $this->createAttribute('sector');