<?php

namespace App\Http\Requests\Rd;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'title' => 'required|string|max:200',
            'input_type' => 'required|in:text,voice,document',
            'input_text' => 'required_if:input_type,text|nullable|string',
            'ai_provider' => 'nullable|in:gemini,claude',
            'quote_mode' => 'nullable|in:module,manufacture',
            'product_category' => 'nullable|in:SCREEN,STEEL',
            'client_company' => 'nullable|string|max:200',
            'client_contact' => 'nullable|string|max:100',
            'client_phone' => 'nullable|string|max:50',
            'client_email' => 'nullable|email|max:200',
        ];
    }

    public function messages(): array
    {
        return [
            'title.required' => '견적 제목을 입력하세요.',
            'title.max' => '제목은 200자 이내로 입력하세요.',
            'input_type.required' => '입력 유형을 선택하세요.',
            'input_text.required_if' => '인터뷰 내용을 입력하세요.',
        ];
    }
}
