on the latest Technical Committee meeting, you can find meeting notes here, I was proposing an idea of introducing new batch fetch endpoint to the Requisition service which would help us implement new batch approval screen for SELV v3. According to @joshzamor comments, we should avoid introducing a new endpoint to the core Requisition service at it was done for Malawi since it is against our microservice infrastructure.
As an action item, I have to describe how current batch fetch endpoint behaves and propose a new design that would suffice both old Malawi batch screen and the new one that is going to be introduced for SELV. Unfortunately, both screens need data aggregated in a very different way to work - one simply uses a list of regular requisitions and the second needs data aggregated by some geographic zones. For me making both using the same endpoint would either mean it would return a completely different response based on some param (which is essentially making 2 different endpoints into one which is not very RESTful) or reworking whole existing batch approval screen for which we probably won’t have enough resources.
@joshzamor mentioned that another possibility would be to introduce a data feed mechanism to Requisition service and I think that is a good solution for this issue. As SELV we could introduce a new microservice that would subscribe to it and aggregate data to our needs. I’m not entirely sure how ideally should this mechanism be designed, but as the SELV team, we could try to introduce some kind of simple working concept. After exchanging a couple of thoughts with @Sebastian_Brudzinski I think it could work something like this:
- we would have a simple endpoint that you subscribe to, specifying how Requisition service should notify you if a change in any requisition occurs
- upon any status change and saving of requisition Requisition service runs a new thread that will go through a list of subscribers and will notify them sending HTTP requests
What do you think about this approach? I assumed the simplest solution as of now, maybe we could include some logic around requisitions changing statues? I would welcome any ideas and comments that you have.