<?php

namespace App\Http\Requests\Member;

use Illuminate\Foundation\Http\FormRequest;

// ══════════════════════════════════════════════════════════════════
//  InPractice — RateDocumentRequest
//  Location: app/Http/Requests/Member/RateDocumentRequest.php
//
//  Validates star rating submissions (1–5) for shared documents.
//  Pattern mirrors RateReplyRequest and RateSolutionRequest.
// ══════════════════════════════════════════════════════════════════

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

    public function rules(): array
    {
        return [
            'rating' => ['required', 'integer', 'min:1', 'max:5'],
        ];
    }

    public function messages(): array
    {
        return [
            'rating.required' => __('documents.rating_required'),
            'rating.min'      => __('documents.rating_range'),
            'rating.max'      => __('documents.rating_range'),
        ];
    }
}