<?php

namespace App\Http\Requests\Wallet;

use App\Http\Requests\ApiFormRequest;

/**
 * 转入 / 转出共用请求体：最小货币单位金额、幂等键、可选币种。
 */
final class WalletTransferRequest extends ApiFormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    /**
     * @return array<string, mixed>
     */
    public function rules(): array
    {
        return [
            'amount' => ['required', 'integer', 'min:1'],
            'currency' => ['sometimes', 'nullable', 'string', 'max:16'],
            'idempotent_key' => ['required', 'string', 'max:64'],
        ];
    }
}
