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

@@ -89,18 +89,12 @@ class AttributeSeeder extends Seeder
],
]);
// Seed Fecha attribute
// Las opciones de fecha se resuelven dinámicamente desde event_dates.
$this->seedAttribute($tenant, [
'codigo' => 'fecha',
'codigo' => 'event_date',
'nombre' => 'Fecha',
'type' => FieldType::Select->value,
'type' => FieldType::EventDate->value,
'is_required' => true,
'options' => [
['value' => '2026-10-09', 'label' => '09/10/2026', 'sort_order' => 1],
['value' => '2026-10-10', 'label' => '10/10/2026', 'sort_order' => 2],
['value' => '2026-10-11', 'label' => '11/10/2026', 'sort_order' => 3],
['value' => '2026-10-12', 'label' => '12/10/2026', 'sort_order' => 4],
],
]);
}
@@ -113,6 +107,13 @@ class AttributeSeeder extends Seeder
->whereIn('codigo', ['talle_numerico', 'fecha'])
->delete();
$this->seedAttribute($tenant, [
'codigo' => 'event_date',
'nombre' => 'Fecha',
'type' => FieldType::EventDate->value,
'is_required' => true,
]);
$breakfastValidityTime = $this->timeWindow('07:00:00', '12:00:00');
$lunchValidityTime = $this->timeWindow('12:00:00', '15:00:00');
$dinnerValidityTime = $this->timeWindow('20:00:00', '24:00:00');

View File

@@ -91,6 +91,7 @@ class FiestaFutbolInfantilProductSeeder extends Seeder
'inventory_policy' => InventoryPolicy::Unlimited->value,
'has_tickets' => true,
'validity_time_id' => $eventValidityTime->id,
'attribute_codes' => ['event_date'],
'variants' => array_map(
fn (string $date): array => [
'real_stock' => 0,