human-essentials icon indicating copy to clipboard operation
human-essentials copied to clipboard

validates the item purchase fields for diapers,

Open jahuang415 opened this issue 9 months ago • 1 comments

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.

jahuang415 avatar Mar 06 '25 20:03 jahuang415

@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.

cielf avatar Apr 07 '25 00:04 cielf

DasTapan's work looks good to me. Close this once it's merged.

cielf avatar Jul 29 '25 17:07 cielf