CLONE - Introduce Backend Batch-Approval Functionality to Core

Description

In order to introduce the backend batch approval endpoints to the core project, a refactor of the permission checks and validators needs to take place first. Currently, most of those in the requisition service throw an exception upon unsuccessful validation/check, which however is NOT desired for the batch endpoints. The batch endpoints should always be able to process all passed requisitions and relying on exceptions simply does not work in this case.

The Malawi requisition service handles this by catching the exceptions. This should not be the case in the core requisition service though (per technical comittee decision). Instead, the validation pattern should be reworked, such that it returns a custom error response that contains a simple flag (validation passed or not) and additional error message(s). This can then be handled by specific endpoints in any way they like - some can throw an exception and others, like batch endpoints will collect the errors and keep on processing.

Prior starting to code, please present the design for this refactor to the technical comittee and get their opinion. Other than the RAML, the design should also briefly talk about the new custom error response (possibly a class diagram).

Acceptance criteria:

  • A test case should also be created in Zephyr for these scenarios: When a user has the correct rights for batch approval, and when the user doesn't have the correct rights for batch approval. It can be one test case.

Activity

Show:
Sam Im
August 4, 2017, 8:54 PM

A test case should also be created in Zephyr for these scenarios: When a user has the correct rights for batch approval, and when the user doesn't have the correct rights for batch approval. It can be one test case.

Paweł Albecki
August 7, 2017, 9:36 AM

sure, I added to acceptance criteria.

Joanna Bebak
August 18, 2017, 9:09 AM

I checked, and all three endpoints - GET, POST and PUT /api/requisitions work correctly. When suitable data are entered, the server returns the "200" code, and e.g. with the use of the POST endpoint, requisitions are approved. When some data are incorrect, e.g. the access token entered is of a user not authorized to edit requisitions, custom error responses instead of exceptions, and appropriate error messages are returned by the server.

Paweł Gesek
August 18, 2017, 1:22 PM

Malawi will be showcasing this

Done

Assignee

Paweł Gesek

Reporter

Paweł Albecki

Labels

Story Points

1

Time tracking

0m

Time remaining

0m

Components

Sprint

None

Fix versions

Priority

Major