<?php

namespace Modules\MembershipApplication\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Modules\MembershipApplication\Enums\ManagementDecision;

class ManagementReviewRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    /**
     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
     */
    public function rules(): array
    {
        return [
            'decision' => ['required', Rule::enum(ManagementDecision::class)],
            'remarks' => 'nullable|string|max:1000',
        ];
    }

    /**
     * @return array<string, string>
     */
    public function messages(): array
    {
        return [
            'decision.required' => 'Keputusan diperlukan.',
            'decision.enum' => 'Keputusan tidak sah. Pilih APPROVED atau REJECTED.',
            'remarks.max' => 'Catatan tidak boleh melebihi 1000 aksara.',
        ];
    }
}
