mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Add some audit logs.
This commit is contained in:
parent
82749cea07
commit
84ae6a633e
@ -21,36 +21,42 @@ class IsValidZeroOrMoreAmount implements ValidationRule
|
||||
// must not be empty:
|
||||
if($this->emptyString($value)) {
|
||||
$fail('validation.filled')->translate();
|
||||
Log::info(sprintf('IsValidZeroOrMoreAmount: "%s" cannot be empty.', $value));
|
||||
|
||||
$message = sprintf('IsValidZeroOrMoreAmount: "%s" cannot be empty.', $value);
|
||||
Log::info($message);
|
||||
Log::channel('audit')->info($message);
|
||||
return;
|
||||
}
|
||||
|
||||
// must be a number:
|
||||
if(!$this->isValidNumber($value)) {
|
||||
$fail('validation.numeric')->translate();
|
||||
Log::info(sprintf('IsValidZeroOrMoreAmount: "%s" is not a number.', $value));
|
||||
|
||||
$message = sprintf('IsValidZeroOrMoreAmount: "%s" is not a number.', $value);
|
||||
Log::info($message);
|
||||
Log::channel('audit')->info($message);
|
||||
return;
|
||||
}
|
||||
// must not be scientific notation:
|
||||
if($this->scientificNumber($value)) {
|
||||
$fail('validation.scientific_notation')->translate();
|
||||
Log::info(sprintf('IsValidZeroOrMoreAmount: "%s" cannot be in the scientific notation.', $value));
|
||||
|
||||
$message = sprintf('IsValidZeroOrMoreAmount: "%s" cannot be in the scientific notation.', $value);
|
||||
Log::info($message);
|
||||
Log::channel('audit')->info($message);
|
||||
return;
|
||||
}
|
||||
// must be zero or more
|
||||
if(!$this->zeroOrMore($value)) {
|
||||
$fail('validation.more_than_zero_correct')->translate();
|
||||
Log::info(sprintf('IsValidZeroOrMoreAmount: "%s" must be zero or more.', $value));
|
||||
|
||||
$message = sprintf('IsValidZeroOrMoreAmount: "%s" must be zero or more.', $value);
|
||||
Log::info($message);
|
||||
Log::channel('audit')->info($message);
|
||||
return;
|
||||
}
|
||||
// must be less than 100 million and 1709:
|
||||
if($this->moreThanLots($value)) {
|
||||
Log::info(sprintf('IsValidPositiveAmount: "%s" must be less than %s.', $value, self::BIG_AMOUNT));
|
||||
$fail('validation.lte.numeric')->translate(['value' => self::BIG_AMOUNT]);
|
||||
$message = sprintf('IsValidPositiveAmount: "%s" must be less than %s.', $value, self::BIG_AMOUNT);
|
||||
Log::info($message);
|
||||
Log::channel('audit')->info($message);
|
||||
}
|
||||
Log::info(sprintf('IsValidZeroOrMoreAmount: "%s" is a valid positive amount.', $value));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user