<?php

declare(strict_types=1);

namespace App\Http\Requests\Admin;

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

class UpdateCustomerRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true; // admin middleware handles auth
    }

    /** @return array<string, array<int, mixed>> */
    public function rules(): array
    {
        return [
            'name' => ['required', 'string', 'max:255'],
            'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($this->route('user'))],
            'phone' => ['nullable', 'string', 'max:50'],
            'company' => ['nullable', 'string', 'max:255'],
            'status' => ['required', 'in:active,suspended,banned'],
            'admin_notes' => ['nullable', 'string', 'max:10000'],
            'override_days_to_suspend' => ['nullable', 'integer', 'min:1'],
            'override_days_to_terminate' => ['nullable', 'integer', 'min:1'],
        ];
    }
}
