<?php

namespace App\Http\Requests\DiningTable;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'name' => ['sometimes', 'required', 'string', 'max:50'],
            'capacity' => ['nullable', 'integer', 'min:1'],
            'status' => ['nullable', 'string', 'in:available,occupied,dirty'],
            'current_order_id' => ['nullable', 'exists:orders,id'],
            'is_active' => ['nullable', 'boolean'],
        ];
    }
}
