<?php

namespace App\Http\Requests;

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

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

    public function rules(): array
    {
        return [
            'appointment_id' => ['required', 'integer'],
            'token_mode' => ['required', Rule::in(['auto', 'manual'])],
            'token_number' => ['nullable', 'required_if:token_mode,manual', 'integer', 'min:1', 'max:9999'],
        ];
    }
}
