991: Requisition status checks missing


Test Case #:284


Test Case Name: Requisition status checks missing

System: OpenLmis

Subsystem: blue

Test case designed by: Lucyna Kwidzińska

Design Date:28.09.2016

Short description

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                       



Step

Action

Expected system response

Comment

1

 Create the requisition.

  URL: http://172.23.0.1/requisition/api/requisitions/initiate?access_token=f8ccb2c4-e9d8-4641-bf80-19da3ee44543

Method: POST

Body:

{

    "id": "221d1318-7c48-4303-bff7-dc65670f4dcf",

    "requisitionLineItems": [ {

              "id": "6aa4ec2f-775c-4f41-bfb1-608f17db59a2",

     "stockInHand": 10,

    "beginningBalance": 5,

    "totalReceivedQuantity": 5,

    "requestedQuantity": 15,

    "totalConsumedQuantity": 4,

    "totalLossesAndAdjustments": 4,

    "stockOnHand": 4,

    "requestedQuantityExplanation": 4,

    "remarks": 4,

    "approvedQuantity": 12,

    "product": {"id":"1752b457-0a4b-4de0-bf94-5a6a8002427e"}

    }

        ],

    "facility":

         "91d1cab7-88cf-4633-9d33-f13406466e62" ,

    "program":

    "4c9b329e-0dc4-460e-b845-3d3af3e997bb",

    "processingPeriod":

     "b907db22-4000-4096-b9f8-6f2833d1c169"

    ,

    "status": "INITIATED",

    "emergency": "false"

}


status: 201 created is returned. Requisition has been created.

                                                                                                                            

                                                 

2

Try to SUBMIT the INITIATED requisition.

URL:  http://172.23.0.1/requisition/api/requisitions/ada26326-dc26-4a0c-95af-c719d5f022b5/submit?access_token=42b83c23-41d4-422c-882c-cded7afbe31c

Method:

Body:


{

"id": "ada26326-dc26-4a0c-95af-c719d5f022b5",

"requisitionLineItems": [ {

"id": "3f9bc767-3dd4-4d18-aaf3-1ad5ae0b85ed",

"stockInHand": 10,

"beginningBalance": 5,

"totalReceivedQuantity": 5,

"requestedQuantity": 15,

"totalConsumedQuantity": 4,

"totalLossesAndAdjustments": 4,

"stockOnHand": 4,

"requestedQuantityExplanation": 4,

"remarks": 4,

"approvedQuantity": 12,

"product": {"id":"1752b457-0a4b-4de0-bf94-5a6a8002427e"}

}

],

"facility": "91d1cab7-88cf-4633-9d33-f13406466e62",

"program": "4c9b329e-0dc4-460e-b845-3d3af3e997bb",

"processingPeriod":

"b907db22-4000-4096-b9f8-6f2833d1c169",

"status": "INITIATED",

"emergency": "false"

}



Requisition has been submitted.

 


3

Try to AUTHORIZE the INITIATED requisition.

URL:  http://172.23.0.1/requisition/api/requisitions/ada26326-dc26-4a0c-95af-c719d5f022b5/authorize?access_token=42b83c23-41d4-422c-882c-cded7afbe31c

Method: PUT

Body:

{

"id": "ada26326-dc26-4a0c-95af-c719d5f022b5",

"requisitionLineItems": [ {

"id": "3f9bc767-3dd4-4d18-aaf3-1ad5ae0b85ed",

"stockInHand": 10,

"beginningBalance": 5,

"totalReceivedQuantity": 5,

"requestedQuantity": 15,

"totalConsumedQuantity": 4,

"totalLossesAndAdjustments": 4,

"stockOnHand": 4,

"requestedQuantityExplanation": 4,

"remarks": 4,

"approvedQuantity": 12,

"product": {"id":"1752b457-0a4b-4de0-bf94-5a6a8002427e"}

}

],

"facility": "91d1cab7-88cf-4633-9d33-f13406466e62",

"program": "4c9b329e-0dc4-460e-b845-3d3af3e997bb",

"processingPeriod":

"b907db22-4000-4096-b9f8-6f2833d1c169",

"status": "INITIATED",

"emergency": "false"

}


Authorizing the initiated requisition is impossible.

 


4

Try to APPROVE the INITIATED requisition

URL:  http://172.23.0.1/requisition/api/requisitions/ada26326-dc26-4a0c-95af-c719d5f022b5/approve?access_token=42b83c23-41d4-422c-882c-cded7afbe31c

Method: PUT

Body:


{

"id": "ada26326-dc26-4a0c-95af-c719d5f022b5",

"requisitionLineItems": [ {

"id": "3f9bc767-3dd4-4d18-aaf3-1ad5ae0b85ed",

"stockInHand": 10,

"beginningBalance": 5,

"totalReceivedQuantity": 5,

"requestedQuantity": 15,

"totalConsumedQuantity": 4,

"totalLossesAndAdjustments": 4,

"stockOnHand": 4,

"requestedQuantityExplanation": 4,

"remarks": 4,

"approvedQuantity": 12,

"product": {"id":"1752b457-0a4b-4de0-bf94-5a6a8002427e"}

}

],

"facility": "91d1cab7-88cf-4633-9d33-f13406466e62",

"program": "4c9b329e-0dc4-460e-b845-3d3af3e997bb",

"processingPeriod":

"b907db22-4000-4096-b9f8-6f2833d1c169",

"status": "INITIATED",

"emergency": "false"

}


 

Approving the initiated requisition is impossible.



5

Try to APPROVE the SUBMITTED requisition.

URL:  http://172.23.0.1/requisition/api/requisitions/ada26326-dc26-4a0c-95af-c719d5f022b5/approve?access_token=42b83c23-41d4-422c-882c-cded7afbe31c

Method: PUT

Body:


{

"id": "ada26326-dc26-4a0c-95af-c719d5f022b5",

"requisitionLineItems": [ {

"id": "3f9bc767-3dd4-4d18-aaf3-1ad5ae0b85ed",

"stockInHand": 10,

"beginningBalance": 5,

"totalReceivedQuantity": 5,

"requestedQuantity": 15,

"totalConsumedQuantity": 4,

"totalLossesAndAdjustments": 4,

"stockOnHand": 4,

"requestedQuantityExplanation": 4,

"remarks": 4,

"approvedQuantity": 12,

"product": {"id":"1752b457-0a4b-4de0-bf94-5a6a8002427e"}

}

],

"facility": "91d1cab7-88cf-4633-9d33-f13406466e62",

"program": "4c9b329e-0dc4-460e-b845-3d3af3e997bb",

"processingPeriod":

"b907db22-4000-4096-b9f8-6f2833d1c169",

"status": "SUBMITTED",

"emergency": "false"

}


Approving the submitted requisition is impossible.

 


6

Try to AUTHORIZE the SUBMITTED requisition.

URL:  http://172.23.0.1/requisition/api/requisitions/ada26326-dc26-4a0c-95af-c719d5f022b5/authorize?access_token=42b83c23-41d4-422c-882c-cded7afbe31c

Method: PUT

Body:


{

"id": "ada26326-dc26-4a0c-95af-c719d5f022b5",

"requisitionLineItems": [ {

"id": "3f9bc767-3dd4-4d18-aaf3-1ad5ae0b85ed",

"stockInHand": 10,

"beginningBalance": 5,

"totalReceivedQuantity": 5,

"requestedQuantity": 15,

"totalConsumedQuantity": 4,

"totalLossesAndAdjustments": 4,

"stockOnHand": 4,

"requestedQuantityExplanation": 4,

"remarks": 4,

"approvedQuantity": 12,

"product": {"id":"1752b457-0a4b-4de0-bf94-5a6a8002427e"}

}

],

"facility": "91d1cab7-88cf-4633-9d33-f13406466e62",

"program": "4c9b329e-0dc4-460e-b845-3d3af3e997bb",

"processingPeriod":

"b907db22-4000-4096-b9f8-6f2833d1c169",

"status": "SUBMITTED",

"emergency": "false"

}

Requisition has been authorized.


7

 Try to APPROVE the AUTHORIZED requisition.

URL:  http://172.23.0.1/requisition/api/requisitions/ada26326-dc26-4a0c-95af-c719d5f022b5/approve?access_token=42b83c23-41d4-422c-882c-cded7afbe31c

Method: PUT

Body:


{

"id": "ada26326-dc26-4a0c-95af-c719d5f022b5",

"requisitionLineItems": [ {

"id": "3f9bc767-3dd4-4d18-aaf3-1ad5ae0b85ed",

"stockInHand": 10,

"beginningBalance": 5,

"totalReceivedQuantity": 5,

"requestedQuantity": 15,

"totalConsumedQuantity": 4,

"totalLossesAndAdjustments": 4,

"stockOnHand": 4,

"requestedQuantityExplanation": 4,

"remarks": 4,

"approvedQuantity": 12,

"product": {"id":"1752b457-0a4b-4de0-bf94-5a6a8002427e"}

}

],

"facility": "91d1cab7-88cf-4633-9d33-f13406466e62",

"program": "4c9b329e-0dc4-460e-b845-3d3af3e997bb",

"processingPeriod":

"b907db22-4000-4096-b9f8-6f2833d1c169",

"status": "AUTHORIZED",

"emergency": "false"

}


Requisition has been approved.

 


8

        Try to SUBMIT the SUBMITTED requisition.

                     URL:  http://172.23.0.1/requisition/api/requisitions/ada26326-dc26-4a0c-95af-c719d5f022b5/submit?access_token=42b83c23-41d4-422c-882c-cded7afbe31c

Method: PUT

Body:


{

"id": "ada26326-dc26-4a0c-95af-c719d5f022b5",

"requisitionLineItems": [ {

"id": "3f9bc767-3dd4-4d18-aaf3-1ad5ae0b85ed",

"stockInHand": 10,

"beginningBalance": 5,

"totalReceivedQuantity": 5,

"requestedQuantity": 15,

"totalConsumedQuantity": 4,

"totalLossesAndAdjustments": 4,

"stockOnHand": 4,

"requestedQuantityExplanation": 4,

"remarks": 4,

"approvedQuantity": 12,

"product": {"id":"1752b457-0a4b-4de0-bf94-5a6a8002427e"}

}

],

"facility": "91d1cab7-88cf-4633-9d33-f13406466e62",

"program": "4c9b329e-0dc4-460e-b845-3d3af3e997bb",

"processingPeriod":

"b907db22-4000-4096-b9f8-6f2833d1c169",

"status": "SUBMITTED",

"emergency": "false"

}


The submitted requisition can't be submitted again.

 


9

Reject the AUTHORIZED Requisition.

  URL:  http://172.23.0.1/requisition/api/requisitions/ada26326-dc26-4a0c-95af-c719d5f022b5/reject?access_token=42b83c23-41d4-422c-882c-cded7afbe31c

Method: PUT

Body:

{

"id": "ada26326-dc26-4a0c-95af-c719d5f022b5",

"requisitionLineItems": [ {

"id": "3f9bc767-3dd4-4d18-aaf3-1ad5ae0b85ed",

"stockInHand": 10,

"beginningBalance": 5,

"totalReceivedQuantity": 5,

"requestedQuantity": 15,

"totalConsumedQuantity": 4,

"totalLossesAndAdjustments": 4,

"stockOnHand": 4,

"requestedQuantityExplanation": 4,

"remarks": 4,

"approvedQuantity": 12,

"product": {"id":"1752b457-0a4b-4de0-bf94-5a6a8002427e"}

}

],

"facility": "91d1cab7-88cf-4633-9d33-f13406466e62",

"program": "4c9b329e-0dc4-460e-b845-3d3af3e997bb",

"processingPeriod":

"b907db22-4000-4096-b9f8-6f2833d1c169",

"status": "AUTHORIZED",

"emergency": "false"

}


Authorized requisition has been rejected.


10

Reject the APPROVED Requisition.

  URL:  http://172.23.0.1/requisition/api/requisitions/ada26326-dc26-4a0c-95af-c719d5f022b5/reject?access_token=42b83c23-41d4-422c-882c-cded7afbe31c

Method: PUT

Body:

{

"id": "ada26326-dc26-4a0c-95af-c719d5f022b5",

"requisitionLineItems": [ {

"id": "3f9bc767-3dd4-4d18-aaf3-1ad5ae0b85ed",

"stockInHand": 10,

"beginningBalance": 5,

"totalReceivedQuantity": 5,

"requestedQuantity": 15,

"totalConsumedQuantity": 4,

"totalLossesAndAdjustments": 4,

"stockOnHand": 4,

"requestedQuantityExplanation": 4,

"remarks": 4,

"approvedQuantity": 12,

"product": {"id":"1752b457-0a4b-4de0-bf94-5a6a8002427e"}

}

],

"facility": "91d1cab7-88cf-4633-9d33-f13406466e62",

"program": "4c9b329e-0dc4-460e-b845-3d3af3e997bb",

"processingPeriod":

"b907db22-4000-4096-b9f8-6f2833d1c169",

"status": "APPROVED",

"emergency": "false"

}


Approved requisition can't be rejecting.


11

Reject the SUBMITTED Requisition.

  URL:  http://172.23.0.1/requisition/api/requisitions/ada26326-dc26-4a0c-95af-c719d5f022b5/reject?access_token=42b83c23-41d4-422c-882c-cded7afbe31c

Method: PUT

Body:

{

"id": "ada26326-dc26-4a0c-95af-c719d5f022b5",

"requisitionLineItems": [ {

"id": "3f9bc767-3dd4-4d18-aaf3-1ad5ae0b85ed",

"stockInHand": 10,

"beginningBalance": 5,

"totalReceivedQuantity": 5,

"requestedQuantity": 15,

"totalConsumedQuantity": 4,

"totalLossesAndAdjustments": 4,

"stockOnHand": 4,

"requestedQuantityExplanation": 4,

"remarks": 4,

"approvedQuantity": 12,

"product": {"id":"1752b457-0a4b-4de0-bf94-5a6a8002427e"}

}

],

"facility": "91d1cab7-88cf-4633-9d33-f13406466e62",

"program": "4c9b329e-0dc4-460e-b845-3d3af3e997bb",

"processingPeriod":

"b907db22-4000-4096-b9f8-6f2833d1c169",

"status": "SUBMITTED",

"emergency": "false"

}


The submitted requisition has been rejected.




Post – conditions:



OpenLMIS: the global initiative for powerful LMIS software