adds validation for all purchase costs variables

This commit is contained in:
Godfrey M 2022-05-10 16:26:06 -07:00
parent 33b1ab3658
commit 2c1f368828
4 changed files with 4 additions and 3 deletions

View file

@ -61,7 +61,7 @@ class Accessory extends SnipeModel
'category_id' => 'required|integer|exists:categories,id', 'category_id' => 'required|integer|exists:categories,id',
'company_id' => 'integer|nullable', 'company_id' => 'integer|nullable',
'min_amt' => 'integer|min:0|nullable', 'min_amt' => 'integer|min:0|nullable',
'purchase_cost' => 'numeric|nullable', 'purchase_cost' => 'numeric|nullable|gte:0',
]; ];

View file

@ -36,7 +36,7 @@ class Component extends SnipeModel
'company_id' => 'integer|nullable', 'company_id' => 'integer|nullable',
'min_amt' => 'integer|min:0|nullable', 'min_amt' => 'integer|min:0|nullable',
'purchase_date' => 'date|nullable', 'purchase_date' => 'date|nullable',
'purchase_cost' => 'numeric|nullable', 'purchase_cost' => 'numeric|nullable|gte:0',
]; ];
/** /**

View file

@ -39,7 +39,7 @@ class Consumable extends SnipeModel
'category_id' => 'required|integer', 'category_id' => 'required|integer',
'company_id' => 'integer|nullable', 'company_id' => 'integer|nullable',
'min_amt' => 'integer|min:0|nullable', 'min_amt' => 'integer|min:0|nullable',
'purchase_cost' => 'numeric|nullable', 'purchase_cost' => 'numeric|nullable|gte:0',
]; ];
/** /**

View file

@ -48,6 +48,7 @@ class License extends Depreciable
'notes' => 'string|nullable', 'notes' => 'string|nullable',
'category_id' => 'required|exists:categories,id', 'category_id' => 'required|exists:categories,id',
'company_id' => 'integer|nullable', 'company_id' => 'integer|nullable',
'purchase_cost'=> 'numeric|nullable|gte:0',
]; ];
/** /**