Requisition service requires Stock service be active

Description

When the requisition service makes calls to the Stock Service, if it cannot find the Stock service (eg, if Stock Management service is not running), the Requisition service should throw an error into its log file AND respond with a 5xx 4xx translatable error message saying something like "Stock service is not found. OpenLMIS Stock Management service is required by this version of Requisition service."

Note: a previous/related ticket, OLMIS-2694, introduces code where the Requisition service calls the Stock service to get a list of reasons. This ticket should go back and add the proper error-handling to the API calls where Requisition service calls Stock service. If those calls between services find that Stock service is not running, the end-user should get the translatable error message described in this ticket.

The requisition service should check if Stock service of at least 1.0.0-beta is active. If you run the Requisition service without the Stock service, it should either throw an error into a log file on start up OR it should respond to all API requests about Requisitions with a 5-4-xx error message saying "Stock service is not found. OpenLMIS Stock Management service is required by this version of Requisition service."

After discussion with Josh, the model of throwing the error at the time a request is made is our current model. We do NOT currently have a pattern to follow for checking on start-up (that is why the paragraph above is crossed out). And we do NOT currently have a model for tracking specific versions of service dependencies (eg, Requisition 4.x.y depends on Stock 1.0.x or higher). So we simplified the description with strikethrough text above to apply our current pattern to the Requisition-Stock connection.

Acceptance Criteria

  • Make Requisition service require Stock service (if Stock is not running, do error handling as above)

  • Document in CHANGELOG of Requisition that Stock is now required (this requirement is going to be part of the 5.0.0 release of Requisition service)

Activity

Show:
Brandon Bowersox-Johnson
August 22, 2017, 4:27 PM

That error message looks perfect!

Paweł Albecki
August 22, 2017, 5:48 PM

It can be hard to show this "feature" on typical showcase, do you want me to record a video for this one?

Brandon Bowersox-Johnson
August 22, 2017, 5:50 PM

Yes, if you make a video that would be a great way to show that situation.

Paweł Albecki
August 24, 2017, 6:39 PM
Brandon Bowersox-Johnson
August 24, 2017, 11:08 PM

Great video! This seems to cover everything and makes it very clear.

Flagged

Assignee

Paweł Albecki

Reporter

Brandon Bowersox-Johnson

Labels

Story Points

3

Time tracking

0m

Time remaining

1h

Epic Link

Components

Sprint

None

Fix versions

Priority

Major