homo #8

Merged
ncoronel merged 79 commits from homo into main 2026-09-17 17:52:21 +00:00
146 changed files with 6731 additions and 468 deletions
Showing only changes of commit c27d9628fd - Show all commits

View File

@@ -59,6 +59,8 @@ class Attribute extends Model
public function eventDates(): HasMany
{
return $this->hasMany(EventDate::class, 'tenant_code', 'tenant_codigo')
->whereNull('rescheduled_to_event_date_id')
->whereNull('suspended_at')
->orderBy('date')
->orderBy('time_start');
}

View File

@@ -220,6 +220,18 @@ class CatalogItemDetailControllerTest extends TestCase
'time_start' => '10:00',
'time_end' => '19:00',
]);
$rescheduledEventDate = $tenant->eventDates()->create([
'date' => '2026-10-08',
'time_start' => '10:00',
'time_end' => '19:00',
'rescheduled_to_event_date_id' => $unusedEventDate->id,
]);
$suspendedEventDate = $tenant->eventDates()->create([
'date' => '2026-10-11',
'time_start' => '10:00',
'time_end' => '19:00',
'suspended_at' => now(),
]);
$item = $this->createItem($tenant, 'Entry');
$attribute = Attribute::query()->create([
'tenant_codigo' => $tenant->codigo,
@@ -245,6 +257,14 @@ class CatalogItemDetailControllerTest extends TestCase
->assertJsonPath('data.attributes.0.options.0.validity_time.type', 'fixed_window')
->assertJsonPath('data.attributes.0.options.1.id', $unusedEventDate->id)
->assertJsonPath('data.attributes.0.options.1.value', (string) $unusedEventDate->id)
->assertJsonMissing([
'id' => $rescheduledEventDate->id,
'value' => (string) $rescheduledEventDate->id,
])
->assertJsonMissing([
'id' => $suspendedEventDate->id,
'value' => (string) $suspendedEventDate->id,
])
->assertJsonPath('data.variants.0.values.event_date.value', (string) $eventDate->id)
->assertJsonPath(
'data.variants.0.values.event_date.label',