<?php

namespace App\Modules\Payroll\Policies;

use App\Models\User;
use App\Modules\Payroll\Models\PayrollAdjustment;

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

    public function view(User $user, PayrollAdjustment $row): bool
    {
        return $user->can('payroll.view') && (int) $user->tenant_id === (int) $row->tenant_id;
    }
}
