feat(ticket): add action capability helpers and expose them in admin resource
This commit is contained in:
@@ -64,6 +64,24 @@ class TicketTest extends TestCase
|
||||
$this->assertSame(Ticket::STATUS_ACTIVE, $ticket->status);
|
||||
}
|
||||
|
||||
public function test_it_exposes_admin_action_capabilities(): void
|
||||
{
|
||||
$tenant = new Tenant([
|
||||
'allow_ticket_total_refund' => true,
|
||||
]);
|
||||
$active = (new Ticket)->setRelation('tenant', $tenant);
|
||||
|
||||
$this->assertTrue($active->is_active());
|
||||
$this->assertTrue($active->can_cancel());
|
||||
$this->assertTrue($active->can_refund());
|
||||
|
||||
$active->used_at = now();
|
||||
|
||||
$this->assertFalse($active->is_active());
|
||||
$this->assertFalse($active->can_cancel());
|
||||
$this->assertFalse($active->can_refund());
|
||||
}
|
||||
|
||||
public function test_fixed_window_controls_ticket_validity(): void
|
||||
{
|
||||
Carbon::setTestNow('2026-07-21 10:00:00');
|
||||
|
||||
Reference in New Issue
Block a user