<?php

declare(strict_types=1);

namespace App\Policies;

use App\Models\User;
use App\Models\WithdrawalRequest;

class WithdrawalRequestPolicy
{
    public function viewAny(User $user): bool
    {
        return true;
    }

    public function view(User $user, WithdrawalRequest $withdrawalRequest): bool
    {
        return $user->hasRole('admin') || $withdrawalRequest->user_id === $user->id;
    }

    public function create(User $user): bool
    {
        return true;
    }
}
