29 lines
636 B
PHP
29 lines
636 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Wallet;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
/**
|
|
* 转入 / 转出共用请求体:最小货币单位金额、幂等键、可选币种。
|
|
*/
|
|
class WalletTransferRequest extends FormRequest
|
|
{
|
|
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'],
|
|
];
|
|
}
|
|
}
|