<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StorePermanentEmployeePunishmentRequest extends FormRequest
{
    public function authorize(): bool
    {
        return (bool) $this->user()?->can('permanent-punishments.create');
    }

    /**
     * @return array<string, array<int, mixed>>
     */
    public function rules(): array
    {
        return [
            'effective_date' => ['required', 'date'],
            'amount' => ['required', 'numeric', 'min:0.01'],
            'reason' => ['required', 'string', 'min:3', 'max:2000'],
        ];
    }
}
