Making Requisition for Approval separate resource

Overview

We've noticed that while approving requisition 2 fields in from Requisition Line Item are used: Remarks and Approved Quantity and both aren't used in other Requisition Workflow steps. For this reason we think that it can be a good idea to move approval step to separate resource.

Proposed solution

Endpoints:

Resource could be named "api/approvalRequistions" and following endpoints would be needed:

  1. GET "api/approvalRequistions/{id}" will be used for getting requisitions by id.
  2. GET "api/approvalRequisitions" will be used for searching through all requisitions for approval
  3. PUT "api/approvalRequisitions/{id}" will be used for saving approval drafts
  4. POST "api/approvalRequisitions/{id}/statusChanges" will be used for approving requisition

There will be no POST endpoint because we cannot create Approval Requsition from API, only by authorizing one. Also we will be deleting "api/requisitionForApproval" and "api/requisitions/{id}/approve" endpoints.

Schema:

Dtos will be mostly reused from Batch Approve endpoint: Requisition Line Item and Requisition. We would only need to add "remarks" property to Requisition Line Item. We are getting rid of some large part of RequisitionDto, like Approved Products. Also Requisition Batch endpoints could be moved to new resource as well.

Problems

  • On the UI when we are entering Product Grid screen there has to be a logic to get Requisition from either "api/requisitions" or "api/approvalRequisitions" based on from which screen we are entering: View Requisition or Approve Requisitions
  • We are not sure based on what info Requisitions are rejected, is total cost and product info enough? is there a need for other properties from Requisition Line Item?

OpenLMIS: the global initiative for powerful LMIS software