<?php

namespace App\Http\Requests\Admin;

use App\Http\Requests\ApiFormRequest;

final class AdminReportQueryRequest extends ApiFormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    /** @return array<string, array<int, mixed>> */
    public function rules(): array
    {
        return [
            'page' => ['sometimes', 'integer', 'min:1'],
            'per_page' => ['sometimes', 'integer', 'min:1', 'max:100'],
            'date_from' => ['sometimes', 'nullable', 'date_format:Y-m-d'],
            'date_to' => ['sometimes', 'nullable', 'date_format:Y-m-d', 'after_or_equal:date_from'],
            'player_id' => ['sometimes', 'nullable', 'integer', 'min:1'],
            'play_code' => ['sometimes', 'nullable', 'string', 'max:32'],
            'agent_node_id' => ['sometimes', 'nullable', 'integer', 'min:1'],
        ];
    }
}
