feat(event): suspend event dates instead of cancelling
This commit is contained in:
@@ -216,11 +216,11 @@ class AdminAppEventControllerTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function test_cancelling_disables_only_tickets_without_another_usable_date(): void
|
||||
public function test_suspending_disables_only_tickets_without_another_usable_date(): void
|
||||
{
|
||||
$tenant = $this->createTenant('acme');
|
||||
$admin = $this->createAdminAppUser($tenant);
|
||||
$cancelledDate = $tenant->eventDates()->create([
|
||||
$suspendedDate = $tenant->eventDates()->create([
|
||||
'date' => '2027-10-09',
|
||||
'time_start' => '09:00',
|
||||
'time_end' => '18:30',
|
||||
@@ -230,16 +230,17 @@ class AdminAppEventControllerTest extends TestCase
|
||||
'time_start' => '09:00',
|
||||
'time_end' => '18:30',
|
||||
]);
|
||||
$singleDateVariant = $this->createVariant($tenant, $cancelledDate->id);
|
||||
$singleDateVariant = $this->createVariant($tenant, $suspendedDate->id);
|
||||
$multipleDateVariant = $this->createVariant($tenant);
|
||||
$multipleDateVariant->eventDates()->sync([$cancelledDate->id, $otherDate->id]);
|
||||
$multipleDateVariant->eventDates()->sync([$suspendedDate->id, $otherDate->id]);
|
||||
$singleDateTicket = $this->createTicket($tenant, $admin, $singleDateVariant);
|
||||
$multipleDateTicket = $this->createTicket($tenant, $admin, $multipleDateVariant);
|
||||
Sanctum::actingAs($admin);
|
||||
|
||||
$this->postJson("/api/v1/adminapp/tenant/event-dates/{$cancelledDate->id}/cancel")
|
||||
$this->postJson("/api/v1/adminapp/tenant/event-dates/{$suspendedDate->id}/suspend")
|
||||
->assertOk()
|
||||
->assertJsonPath('data.status', 'cancelled');
|
||||
->assertJsonPath('data.status', 'suspended')
|
||||
->assertJsonPath('data.suspended_at', fn ($value) => is_string($value));
|
||||
|
||||
$this->assertNotNull($singleDateTicket->fresh()->disabled_at);
|
||||
$this->assertNull($multipleDateTicket->fresh()->disabled_at);
|
||||
@@ -249,7 +250,7 @@ class AdminAppEventControllerTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function test_cancelling_a_reschedule_destination_disables_tickets_from_predecessor_dates(): void
|
||||
public function test_suspending_a_reschedule_destination_disables_tickets_from_predecessor_dates(): void
|
||||
{
|
||||
$tenant = $this->createTenant('acme');
|
||||
$admin = $this->createAdminAppUser($tenant);
|
||||
@@ -271,7 +272,7 @@ class AdminAppEventControllerTest extends TestCase
|
||||
);
|
||||
Sanctum::actingAs($admin);
|
||||
|
||||
$this->postJson("/api/v1/adminapp/tenant/event-dates/{$destination->id}/cancel")
|
||||
$this->postJson("/api/v1/adminapp/tenant/event-dates/{$destination->id}/suspend")
|
||||
->assertOk();
|
||||
|
||||
$this->assertNotNull($ticket->fresh()->disabled_at);
|
||||
|
||||
Reference in New Issue
Block a user