<?php

namespace App\Http\Requests\Api;

use Illuminate\Foundation\Http\FormRequest;

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

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