feat: add support for multiple event dates in variants
- Updated the FeaturedGroupService to include 'variants.eventDates' in the items query. - Introduced a BelongsToMany relationship in EventDate for selected variants. - Modified PurchaseItemResource and PurchaseItemSnapshotFactory to handle multiple event dates for variants. - Enhanced StartCheckoutService to load event dates for variants. - Updated TicketGeneratorService to accommodate event dates in ticket generation. - Created migrations to support multi-value event dates and allow multiple variant values per attribute. - Adjusted seeders to reflect new event date handling and added new attributes. - Added tests to ensure correct functionality for multi-date variants and their integration with ticket generation.
This commit is contained in:
@@ -104,7 +104,14 @@ class AttributeSeeder extends Seeder
|
||||
{
|
||||
Attribute::query()
|
||||
->where('tenant_codigo', $tenant->codigo)
|
||||
->whereIn('codigo', ['talle_numerico', 'fecha'])
|
||||
->whereNotIn('codigo', [
|
||||
'event_date',
|
||||
'servicio',
|
||||
'color',
|
||||
'horario',
|
||||
'talle',
|
||||
'tipo_alojamiento',
|
||||
])
|
||||
->delete();
|
||||
|
||||
$this->seedAttribute($tenant, [
|
||||
@@ -118,6 +125,17 @@ class AttributeSeeder extends Seeder
|
||||
$lunchValidityTime = $this->timeWindow('12:00:00', '15:00:00');
|
||||
$dinnerValidityTime = $this->timeWindow('20:00:00', '24:00:00');
|
||||
|
||||
$this->seedAttribute($tenant, [
|
||||
'codigo' => 'tipo_alojamiento',
|
||||
'nombre' => 'TipoAlojamiento',
|
||||
'type' => FieldType::Select->value,
|
||||
'is_required' => true,
|
||||
'options' => [
|
||||
['value' => 'Carpa', 'label' => 'Carpa', 'sort_order' => 1],
|
||||
['value' => 'Motorhome', 'label' => 'Motorhome', 'sort_order' => 2],
|
||||
],
|
||||
]);
|
||||
|
||||
$this->seedAttribute($tenant, [
|
||||
'codigo' => 'servicio',
|
||||
'nombre' => 'Servicio',
|
||||
|
||||
Reference in New Issue
Block a user