Add amount check. Not sure why rule doesn't fire.

This commit is contained in:
James Cole 2022-09-18 05:53:11 +02:00
parent e5bc074e68
commit eef14ced59
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80

View File

@ -66,5 +66,10 @@ trait ValidatesAutoBudgetRequest
if (null !== $currencyId && null !== $currencyCode && '' === $currencyCode && 0 === $currencyId) {
$validator->errors()->add('auto_budget_amount', (string) trans('validation.require_currency_info'));
}
// too big amount
if((int)$amount > 16777216) {
$validator->errors()->add('auto_budget_amount', (string) trans('validation.amount_required_for_auto_budget'));
return;
}
}
}