mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-22 17:06:39 -06:00
Catch amounts.
This commit is contained in:
parent
51ca8277bb
commit
e318e8e9cf
@ -64,11 +64,11 @@ class StoreRequest extends FormRequest
|
||||
{
|
||||
return [
|
||||
'name' => 'required|between:1,255|uniquePiggyBankForUser',
|
||||
'current_amount' => ['numeric', 'gte:0', 'lte:target_amount'],
|
||||
'current_amount' => ['numeric', 'gte:0', 'lte:target_amount','max:1000000000'],
|
||||
'account_id' => 'required|numeric|belongsToUser:accounts,id',
|
||||
'object_group_id' => 'numeric|belongsToUser:object_groups,id',
|
||||
'object_group_title' => 'between:1,255',
|
||||
'target_amount' => ['numeric', 'gte:0', 'lte:target_amount', 'required'],
|
||||
'target_amount' => ['numeric', 'gte:0', 'lte:target_amount', 'required','max:1000000000'],
|
||||
'start_date' => 'date|nullable',
|
||||
'target_date' => 'date|nullable|after:start_date',
|
||||
'notes' => 'max:65000',
|
||||
|
@ -69,8 +69,8 @@ class UpdateRequest extends FormRequest
|
||||
|
||||
return [
|
||||
'name' => 'between:1,255|uniquePiggyBankForUser:'.$piggyBank->id,
|
||||
'current_amount' => ['numeric', 'gte:0', new LessThanPiggyTarget()],
|
||||
'target_amount' => 'numeric|gte:0',
|
||||
'current_amount' => ['numeric', 'gte:0', new LessThanPiggyTarget(),'max:1000000000'],
|
||||
'target_amount' => 'numeric|gte:0|max:1000000000',
|
||||
'start_date' => 'date|nullable',
|
||||
'target_date' => 'date|nullable|after:start_date',
|
||||
'notes' => 'max:65000',
|
||||
|
@ -92,8 +92,8 @@ class StoreRequest extends FormRequest
|
||||
'repetitions.*.weekend' => 'numeric|min:1|max:4',
|
||||
|
||||
'transactions.*.description' => 'required|between:1,255',
|
||||
'transactions.*.amount' => 'required|numeric|gt:0',
|
||||
'transactions.*.foreign_amount' => 'nullable|numeric|gt:0',
|
||||
'transactions.*.amount' => 'required|numeric|gt:0|max:1000000000',
|
||||
'transactions.*.foreign_amount' => 'nullable|numeric|gt:0|max:1000000000',
|
||||
'transactions.*.currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
|
||||
'transactions.*.currency_code' => 'nullable|min:3|max:51|exists:transaction_currencies,code',
|
||||
'transactions.*.foreign_currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
|
||||
|
@ -99,8 +99,8 @@ class UpdateRequest extends FormRequest
|
||||
'repetitions.*.weekend' => 'nullable|numeric|min:1|max:4',
|
||||
|
||||
'transactions.*.description' => 'between:1,255',
|
||||
'transactions.*.amount' => 'numeric|gt:0',
|
||||
'transactions.*.foreign_amount' => 'nullable|numeric|gt:0',
|
||||
'transactions.*.amount' => 'numeric|gt:0|max:1000000000',
|
||||
'transactions.*.foreign_amount' => 'nullable|numeric|gt:0|max:1000000000',
|
||||
'transactions.*.currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
|
||||
'transactions.*.currency_code' => 'nullable|min:3|max:51|exists:transaction_currencies,code',
|
||||
'transactions.*.foreign_currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
|
||||
|
Loading…
Reference in New Issue
Block a user