226: Convert approved requisition to orders

Test Case #:226

 

Test Case Name: Convert approved requisition to orders

System: openLMIS

Subsystem: requisition

Test case designed by: Lucyna Kwidzinska

Design Date:10.08.2016

Short description: As a storeroom manager creating a requisition, I want my requisitions to be converted to an order  for my filling warehouse once my requisition has been approved so that supplying warehouse is aware of my stock needs.


Verify That

  • approved requisitions are converted to an order (an order file is created)
  • an order object is associated with the requisition
  • requisition status is updated
  • an unique order number is assigned (order number is generated based on the order number configuration)

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                       

 

 

Step

Action

Expected system response

Comment

 Note: Remember to generate token for authentication using some rest client. Copy the token from response (e.g. {"access_token":"121d02ed-b6b4-4233-9566-cac2b8a3aec9"...).

The token will expire after 1 hour. Then, it's necessary to generate the new one.

1


Create geographicZone

URL: http://localhost:8080/api/geographicZones/?access_token=68be1238-021f-4126-a676-8fdb7dca0d6d

Method: POST

Example body:

{

"code": "zonecode",

"name": "zonename",

"level": "http://localhost:8080/api/geographicLevels/37bf6690-9fdd-4b90-bb51-1d9e83d1d0b2"

}


                                                                                                          
                 status: 201 created is returned,             

id: "http://localhost:8080/api/geographicZones/e39d79d7-6c65-47ac-9be5-c4090b40753c"

                                                                              
                                                 

2

Create geographicLevel

URL: http://localhost:8080/api/geographicLevels/?access_token=68be1238-021f-4126-a676-8fdb7dca0d6d

Method: POST

Example body:

{

"code": "levelcode",

"name": "levelname",

"levelNumber": "2"

}

  status: 201 created is returned,  

id: "http://localhost:8080/api/geographicLevels/37bf6690-9fdd-4b90-bb51-1d9e83d1d0b2"

 

3

Create facilityType

URL: http://localhost:8080/api/facilityTypes/?access_token=68be1238-021f-4126-a676-8fdb7dca0d6d

Method: POST

Example body:

{

"code": "codefac",

"name": "namefac",

"description": "abc"

}

 

4

Create Schedule

URL: http://localhost:8080/api/schedules/?access_token=68be1238-021f-4126-a676-8fdb7dca0d6d

Method: POST

Example body:

{

"code": "schedulecode",

"description": "desccode",

"name": "schedulename"

}

 

5

Create Period

URL: http://localhost:8080/api/periods/?access_token=68be1238-021f-4126-a676-8fdb7dca0d6d

Method: POST

Example body:

{

"processingSchedule": {

"id": "136e5c30-8bf0-437c-b8b2-7485fbd966c4",

"code": "schedulecode",

"description": "desccode",

"name": "schedulename"

},

"name": "periodname",

"description": "descperiod",

"startDate": "2016-08-10",

"endDate": "2016-08-12"

}

 

6

Create program

URL: http://localhost:8080/api/programs/?access_token=68be1238-021f-4126-a676-8fdb7dca0d6d

Method: POST

Example body:

{

"code": "programcode",

"name": "programname",

"periodsSkippable": "true"

}

 

7

Create facility

URL: http://localhost:8080/api/facilities/?access_token=68be1238-021f-4126-a676-8fdb7dca0d6d

Method: POST

Example body:

{

"code": "facilitycode",

"name": "facilityname",

"descirption": "abc",

"geographicZone": "http://localhost:8080/api/geographicZones/e39d79d7-6c65-47ac-9be5-c4090b40753c",

"type": "http://localhost:8080/api/facilityTypes/9ee2532c-3cea-4fbc-8e80-e18548a2365b",

"active": "true",

"enabled": "true"

}

 

8

                      

SupervisoryNode.

URL: http://localhost:8080/api/supervisoryNodes/?access_token=68be1238-021f-4126-a676-8fdb7dca0d6d

Method: POST

Example body:

{

"code": "nodecode",

"name": "nodename",

"facility": "http://localhost:8080/api/facilities/314e7992-c717-4ae1-89fa-821c15bc2c37"

 

}


                          

 

9

Create supplyLine.

URL: http://localhost:8080/api/supplyLines/?access_token=68be1238-021f-4126-a676-8fdb7dca0d6d

Method: POST

Example body:

{

"supervisoryNode": "http://localhost:8080/api/supervisoryNodes/2e7cce9d-dabd-43ae-9283-05be2471ad21",

"program":"http://localhost:8080/api/programs/25946e13-b09e-4417-a074-c61df0834886",

"supplyingFacility": "http://localhost:8080/api/facilities/314e7992-c717-4ae1-89fa-821c15bc2c37"

}

 
10

Create requisition.

URL: http://localhost:8080/api/requisitions/?access_token=68be1238-021f-4126-a676-8fdb7dca0d6d

Method: POST

Example body:

{

"facility": "http://localhost:8080/api/facilities/314e7992-c717-4ae1-89fa-821c15bc2c37",

"program":"http://localhost:8080/api/programs/25946e13-b09e-4417-a074-c61df0834886",

"processingPeriod": "http://localhost:8080/api/periods/45dbaf0f-6be7-462f-b66e-530317eb03ae",

"status": "APPROVED",

"emergency": "true",

"supervisoryNode": "http://localhost:8080/api/supervisoryNodes/2e7cce9d-dabd-43ae-9283-05be2471ad21"

}

 
11

Try to convert requisition to order.

URL: http://localhost:8080/api/orders/requisitions/?access_token=68be1238-021f-4126-a676-8fdb7dca0d6d

Method: POST

Example body:

[

   { "id":  "381204d6-f801-4a10-8d44-fc1734c33592"}

]

status: 201 created is returned.

The status of requisition is changed to RELEASED.

 
12

Verify if order is created.

URL: http://localhost:8080/api/orders?access_token=68be1238-021f-4126-a676-8fdb7dca0d6d

Method: GET

 

status: 200 OK is returned.

 

 

 

Post – conditions:

OpenLMIS: the global initiative for powerful LMIS software