feat(event): omit rescheduled and suspended dates from tenant resource
This commit is contained in:
@@ -172,7 +172,7 @@ class AdminAppEventControllerTest extends TestCase
|
||||
|
||||
public function test_rescheduling_reuses_an_existing_date_and_tickets_resolve_its_validity(): void
|
||||
{
|
||||
$tenant = $this->createTenant('acme');
|
||||
$tenant = $this->createActiveEvent($this->createTenant('acme'), 'Festival Acme');
|
||||
$admin = $this->createAdminAppUser($tenant);
|
||||
$original = $tenant->eventDates()->create([
|
||||
'date' => '2027-10-09',
|
||||
@@ -196,6 +196,12 @@ class AdminAppEventControllerTest extends TestCase
|
||||
->assertJsonPath('data.rescheduled_to_event_date_id', $destination->id);
|
||||
|
||||
$this->assertDatabaseCount('event_dates', 2);
|
||||
$this->assertSame('20 de Octubre 2027', $tenant->fresh()->event_date_text);
|
||||
$this->getJson('/api/tenants/bootstrap?dominio=acme.test&path=%2F')
|
||||
->assertOk()
|
||||
->assertJsonCount(1, 'data.event.dates')
|
||||
->assertJsonPath('data.event.dates.0.id', $destination->id)
|
||||
->assertJsonPath('data.event_date_text', '20 de Octubre 2027');
|
||||
$this->assertSame(
|
||||
'2027-10-20 11:00:00',
|
||||
$ticket->resolvedValidity()->effectiveStartsAt()?->format('Y-m-d H:i:s'),
|
||||
@@ -210,6 +216,12 @@ class AdminAppEventControllerTest extends TestCase
|
||||
])->assertOk()->assertJsonPath('data.status', 'rescheduled');
|
||||
|
||||
$this->assertDatabaseCount('event_dates', 3);
|
||||
$this->assertSame('25 de Octubre 2027', $tenant->fresh()->event_date_text);
|
||||
$this->getJson('/api/tenants/bootstrap?dominio=acme.test&path=%2F')
|
||||
->assertOk()
|
||||
->assertJsonCount(1, 'data.event.dates')
|
||||
->assertJsonPath('data.event.dates.0.date', '2027-10-25')
|
||||
->assertJsonPath('data.event_date_text', '25 de Octubre 2027');
|
||||
$this->assertSame(
|
||||
'2027-10-25 11:00:00',
|
||||
$ticket->fresh()->resolvedValidity()->effectiveStartsAt()?->format('Y-m-d H:i:s'),
|
||||
@@ -218,7 +230,7 @@ class AdminAppEventControllerTest extends TestCase
|
||||
|
||||
public function test_suspending_disables_only_tickets_without_another_usable_date(): void
|
||||
{
|
||||
$tenant = $this->createTenant('acme');
|
||||
$tenant = $this->createActiveEvent($this->createTenant('acme'), 'Festival Acme');
|
||||
$admin = $this->createAdminAppUser($tenant);
|
||||
$suspendedDate = $tenant->eventDates()->create([
|
||||
'date' => '2027-10-09',
|
||||
@@ -244,6 +256,12 @@ class AdminAppEventControllerTest extends TestCase
|
||||
|
||||
$this->assertNotNull($singleDateTicket->fresh()->disabled_at);
|
||||
$this->assertNull($multipleDateTicket->fresh()->disabled_at);
|
||||
$this->assertSame('10 de Octubre 2027', $tenant->fresh()->event_date_text);
|
||||
$this->getJson('/api/tenants/bootstrap?dominio=acme.test&path=%2F')
|
||||
->assertOk()
|
||||
->assertJsonCount(1, 'data.event.dates')
|
||||
->assertJsonPath('data.event.dates.0.id', $otherDate->id)
|
||||
->assertJsonPath('data.event_date_text', '10 de Octubre 2027');
|
||||
$this->assertSame(
|
||||
'2027-10-10 09:00:00',
|
||||
$multipleDateTicket->fresh()->resolvedValidity()->effectiveStartsAt()?->format('Y-m-d H:i:s'),
|
||||
|
||||
Reference in New Issue
Block a user