<?php

namespace App\Http\Requests\Member;

use Illuminate\Foundation\Http\FormRequest;

// ══════════════════════════════════════════════════════════════════
//  InPractice — RateSolutionRequest
//  Location: app/Http/Requests/Member/RateSolutionRequest.php
//
//  Validates star rating submissions (1–5).
//  Used for both member solution ratings and InPractice solution ratings.
// ══════════════════════════════════════════════════════════════════

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

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

    public function messages(): array
    {
        return [
            'rating.required' => __('cases.rating_required'),
            'rating.between'  => __('cases.rating_between'),
        ];
    }
}
