<?php

namespace App\Http\Requests\AI;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'latest_customer_message' => ['required', 'string', 'max:5000'],
            'language' => ['nullable', 'string', 'in:en,ar'],
            'recent_history' => ['nullable', 'array', 'max:30'],
            'recent_history.*' => ['string', 'max:1500'],
            'saved_replies' => ['nullable', 'array', 'max:10'],
            'saved_replies.*' => ['string', 'max:1500'],
            'relevant_products' => ['nullable', 'array', 'max:10'],
            'relevant_products.*.name' => ['nullable', 'string', 'max:255'],
            'relevant_products.*.price' => ['nullable'],
            'relevant_products.*.stock' => ['nullable'],
        ];
    }
}
