<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class TestSendSmsTemplateRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()?->can('manage-settings') ?? false;
    }

    public function rules(): array
    {
        return [
            'to' => ['required', 'string', 'max:30'],
            'variables' => ['nullable', 'array'],
            'profile_id' => ['nullable', 'integer', 'exists:sms_profiles,id'],
            'sender_id' => ['nullable', 'integer', 'exists:sms_senders,id'],
            'delivery_report' => ['sometimes', 'boolean'],
            'country_code' => ['nullable', 'string', 'max:5'],
            'custom_content' => ['nullable', 'string', 'max:1000'],
        ];
    }
}
