validates the item purchase fields for diapers,
Resolves #5059
Description
Before the change, a user could a new purchase with negative dollar values for the respective items (other, incontinence, etc.) and it would be valid so long as the total sum was correct and greater than zero.
A validation was added such that each purchase item must be greater than or equal to zero, and a respective rspec test was added to check.
Type of change
- Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
Create a new purchase, and set the following values respectively: 1, -1, 2, 0, 0. This will submit successfully, which is incorrect.
Following the change, this will produce an error and not submit.
@dorner -- do you want to take a technical pass on this? My nitpick is small enough that we could just edit the file on behalf of @jahuang415 , methinks.
DasTapan's work looks good to me. Close this once it's merged.