Ability to delete SKIPPED requisitions

Description

Abstract
It becomes a common case in Malawi that users mistakenly skip a requisition for a given period. This is currently problematic, since once a requisition is skipped, there is no going back. There's no way to revert or cancel the skipped requisition other than by a developer manually doing this in the database.

Proposed solution
Allow deleting SKIPPED requisitions. In a case where user skips a requisition mistakenly, such skipped requisition could simply be deleted, which would allow user to re-initiate a requisition for the same period. A skipped requisition could only be deleted if no regular requisition for the next period was created. This is already enforced in the delete requisition endpoint and wouldn't require any further changes. The skipped requisition would be accessible via the "View Requisitions" screen (Requisition -> View). The view requisition screen shows requisitions in all states (including skipped) and would allow user to navigate to a skipped requisition.

Design/Acceptance criteria

  • make DELETE /requisitions/id endpoint work for a requisition that is in "SKIPPED" state

  • invoking the above endpoint for skipped requisition would require REQUISITION_DELETE and REQUISITION_CREATE right

  • attempting to delete skipped requisition for a given period when a requisition for the next period was already created should fail - this is currently enforced and should continue to be

  • the delete behaviour works exactly as it would for INITIATED and SUBMITTED requisitions, allowing users to re-initiate a requisition for the given period

  • the UI would display the "Delete requisition" button when viewing skipped requisition and when user has got the necessary rights (delete + create)

  • the above is covered by unit/integration tests

Status

Assignee

Sebastian Brudziński

Reporter

Joseph Mtenje

Story Points

1

Time tracking

8h

Components

Sprint

None

Fix versions

Priority

Major
Configure