<?php

namespace Modules\MembershipApplication\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

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

    /**
     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
     */
    public function rules(): array
    {
        return [
            'application_ids' => 'required|array|min:1|max:100',
            'application_ids.*' => 'required|uuid|distinct|exists:membership_applications,id',
        ];
    }

    /**
     * @return array<string, string>
     */
    public function messages(): array
    {
        return [
            'application_ids.required' => 'Senarai permohonan diperlukan.',
            'application_ids.min' => 'Sekurang-kurangnya satu permohonan diperlukan.',
            'application_ids.max' => 'Maksimum 100 permohonan setiap batch.',
            'application_ids.*.exists' => 'Salah satu permohonan tidak dijumpai.',
            'application_ids.*.distinct' => 'Permohonan duplikat tidak dibenarkan.',
        ];
    }
}
