219: Deleting a requisition/R&R

Test Case #: 219

Test Case Name: Deleting a requisition/R&R

System: OpenLMIS

Subsystem:Requisition

Test case designed by: Anna Czyrko

Design Date:02.08.2016

Short description

  • there is a mechanism to delete an unsubmitted (status equals initiated) requisition
  • the user can view a saved/unsubmitted requisition
  • the system provides an 'action confirmation message' (eg. Are you sure that you want to delete this requisition?) prior to deletion
  • if the user cancels the delete action the user is brought back to the draft requisition

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                       

 

 

Step

Action

Expected system response

Comment

1

Create Facility type

URL: http://localhost:8080/api/facilityTypes

Method: Post

Body:

{

"code": "12"

}

Status: 201 Created

 

Remember id.

2

Create Geographic Level

URL: http://localhost:8080/api/geographicLevels

Method: Post

Body:

{

"code": "1",

"levelNumber": "14"

}

 

Status: 201 Created

Remember id.

3

Create Geographic Zone.

URL: http://localhost:8080/api/geographicZones

Method: Post

Body:

{

"code": "1",

"level": "http://localhost:8080/api/geographicLevels/8e516386-6637-4e7a-b8d7-36b03d9bbd96"

}

Status: 201 Created

Remember id.
4

Create Facility entity.

URL: http://localhost:8080/api/facilities

Method: Post

Body:

{

"code": "test",

"geographicZone": "http://localhost:8080/api/geographicZones/5a4a4cb6-2e46-4ae9-844c-b29072750294",

"type": "http://localhost:8080/api/facilityTypes/b6b3001c-bd42-40c5-837b-a9bfa1f018a4",

"active": true,

"enabled": false

}

Status: 201 Created

Remember id.
5

Create Program entity.

URL: http://localhost:8080/api/programs

Method: Post

Body:

{

"code": "15"

}

Status: 201 Created

Remember id.
6

Create Schedule entity.

URL: http://localhost:8080/api/schedules

Method: Post

Body:

{

"code":"123",

"name": "test"

}

 

Status: 201 Created

Remember id.
7

Create Period entity.

URL: http://localhost:8080/api/periods

Method: Post

Body:

{

"processingSchedule":

{

"id": "5c459ef5-c3b1-4bbc-953a-aaeff67fbde9",

"code": "123",

"description": null,

"modifiedDate": "2016-07-26T09:39:54.533",

"name": "test"

},

"name":"test",

"description":"periodDescription",

"startDate":"2016-07-25",

"endDate":"2016-07-27"

}

Status: 201 Created

Remember id.
8

Create Requisition entity.

URL: http://localhost:8080/api/requisitions

Method: Post

Body:

{

"facility": "http://localhost:8080/api/facilities/102fe654-e51e-40b3-aa15-26fbc20e80d7",

"program": "http://localhost:8080/api/programs/4712b847-ec5f-4b04-9f8b-63728933cca6",

"processingPeriod": "http://localhost:8080/api/periods/7958b22c-655a-4842-aef1-3463bec9e3c3",

"status": "INITIATED"

}

Status: 201 Created

Remember id
9

Delete Requisition entity with any other status than INITIATED

URL: http://localhost:8080/api/requisitions/837399ea-5de8-49e7-8b0c-f56b964e1f10

Method: Delete

Status: 400 Bad Request

 

 
10

Delete Requisition entity with Initiated status.

URL: http://localhost:8080/api/requisitions/01bbaea6-2138-40c9-b37f-c48d8c437b9e

Method: Delete


Status: 204 No content

 
11   
12   
13   
14   
15   
16   

 

 

Post – conditions:

                                                                                                                   

OpenLMIS: the global initiative for powerful LMIS software