<?php

namespace App\Policies;

use App\Models\ProductReservation;
use App\Models\User;

class ProductReservationPolicy
{
    public function viewAny(User $user): bool
    {
        return $user->can('reservations.view');
    }

    public function view(User $user, ProductReservation $productReservation): bool
    {
        return $user->can('reservations.view');
    }

    public function create(User $user): bool
    {
        return $user->can('reservations.manage');
    }

    public function delete(User $user, ProductReservation $productReservation): bool
    {
        return $user->can('reservations.manage') && $productReservation->isPending();
    }
}
