<?php

namespace App\Http\Requests\Admin\Finance;

use App\Enums\Permission;
use Illuminate\Foundation\Http\FormRequest;

class PayEmployeeAdvanceRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()?->can(Permission::EMPLOYEE_ADVANCES_PAY->value) ?? false;
    }

    public function rules(): array
    {
        return [
            'amount' => ['nullable', 'integer', 'min:1'],
        ];
    }
}
