refactor(catalog): add event date attribute with dynamic options and update related logic

This commit is contained in:
2026-08-07 10:03:31 -03:00
parent 14d53d1e0b
commit 717ee5d194
11 changed files with 224 additions and 86 deletions

View File

@@ -57,6 +57,18 @@ class CatalogModelsTest extends TestCase
$this->assertInstanceOf(AttributeOption::class, $attribute->options()->getRelated());
}
public function test_event_date_is_an_attribute_type_with_dynamic_options(): void
{
$attribute = new Attribute;
$attribute->type = FieldType::EventDate->value;
$this->assertSame(FieldType::EventDate, $attribute->type);
$this->assertTrue($attribute->type->supportsOptions());
$this->assertTrue($attribute->type->usesDynamicOptions());
$this->assertContains('event_date', FieldType::values());
$this->assertInstanceOf(EventDate::class, $attribute->eventDates()->getRelated());
}
public function test_catalog_item_is_the_catalog_root(): void
{
$item = new CatalogItem;