<?php

namespace App\Http\Requests\Notification;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

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

    public function rules(): array
    {
        return [
            'type' => ['required', Rule::in(['email', 'whatsapp', 'telegram'])],
            'value' => ['required', 'string', 'max:255'],
            'label' => ['nullable', 'string', 'max:100'],
            'is_primary' => ['nullable', 'boolean'],
            'is_verified' => ['nullable', 'boolean'],
            'can_receive_transactional' => ['nullable', 'boolean'],
            'can_receive_broadcast' => ['nullable', 'boolean'],
            'opted_out_at' => ['nullable', 'date'],
        ];
    }
}
