<?php

namespace App\Http\Requests\Ticket;

use App\Http\Requests\ApiFormRequest;

abstract class TicketBetRequest extends ApiFormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    /**
     * @return array<string, mixed>
     */
    public function rules(): array
    {
        return [
            'draw_id' => ['required', 'string', 'max:32'],
            'currency_code' => ['required', 'string', 'max:16'],
            'client_trace_id' => ['nullable', 'string', 'max:64'],
            'lines' => ['required', 'array', 'min:1', 'max:100'],
            'lines.*.number' => ['required', 'string', 'max:32'],
            'lines.*.play_code' => ['required', 'string', 'max:32'],
            'lines.*.amount' => ['required', 'integer', 'min:1'],
            'lines.*.digit_slot' => ['nullable', 'integer', 'min:0', 'max:3'],
            'lines.*.dimension' => ['nullable', 'string', 'in:D2,D3,D4'],
        ];
    }
}
