<?php

namespace Modules\HR\Policies;

use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;
use Modules\HR\Models\SalaryRevision;

class SalaryRevisionPolicy
{
    use HandlesAuthorization;

    public function viewAny(User $user): bool
    {
        return $user->can('hr.setting.manage')
            || $user->can('hr.salary-revision-status.approved')
            || $user->can('hr.salary-revision-status.applied');
    }

    public function approved(User $user, SalaryRevision $salaryRevision): bool
    {
        return $user->can('hr.salary-revision-status.approved');
    }


    public function applied(User $user, SalaryRevision $salaryRevision): bool
    {
        return $user->can('hr.salary-revision-status.applied');
    }
}
