Incorrect validation of the pricePerPack field in PUT orderables/id endpoint


While checking OLMIS-6413, I noticed that negative values ​​can be entered in the "pricePerPack" field using PUT api/orderables/id endpoint.
Then the total requisition coast also shows the minus values.

Reproduction steps:

  1. Log into the application as an administrator and obtain the user's access token.

  2. Update any orderable with the use of the PUT api/orderables/id endpoint so that the pricePerPack value is, e.g. -10.
    Sample body:

  3. Go to Requisition > Create/Authorize and inititate a new requisition.

  4. Fill in the required fields for just-updated product.

  5. The minus values occurs in the Price Per Pack and Toal requisition cost fields.

Expected results:

  • This field shouldn't accept negative values.




Chongsun Ahn
November 25, 2020, 6:02 PM

I tried a PUT /api/orderables/id using the request body in the description and got the correct error. Moving to Done.

Joanna Szymańska
November 24, 2020, 9:22 AM

Hi ! I moved this ticket to In Progress because there were some issues with Sonar. I am asking you to look at it first.

Joanna Bebak
January 21, 2020, 10:53 AM

The issue is still valid.

Joanna Szymańska
August 27, 2019, 12:43 PM

Reviewed. This issue is still valid.

Joanna Bebak
August 27, 2019, 11:39 AM

Please check if this issue is still valid.



elly makuba


Joanna Szymańska