<?php

namespace App\Http\Requests\Api;

use Illuminate\Foundation\Http\FormRequest;

class PurchaseCableRequest extends BaseApiRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'smartcard_number' => ['required', 'string'],
            'provider' => ['required', 'string'],
            'variation_code' => ['required', 'string'],
            'amount' => ['required', 'numeric', 'min:100'],
            'phone' => ['nullable', 'string', 'max:20'],
            'subscription_type' => ['nullable', 'string', 'in:renew,change'],
            'idempotency_key' => ['nullable', 'string', 'unique:transactions,idempotency_key'],
        ];
    }
}
