<?php

namespace App\Http\Requests\Quality;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'ids' => ['required', 'array', 'min:1'],
            'ids.*' => ['required', 'integer', 'exists:performance_reports,id'],
        ];
    }

    public function messages(): array
    {
        return [
            'ids.required' => __('validation.required', ['attribute' => '실적신고 ID']),
            'ids.min' => __('validation.min.array', ['attribute' => '실적신고 ID', 'min' => 1]),
        ];
    }
}
