741: Create a simple requisition with additional stock information

741: Create a simple requisition with additional stock information

Test Case #: 741

Test Case Name: Create a simple requisition with additional stock information

System: OpenLMIS

Subsystem:Requisition

Test case designed by: Anna Czyrko

Design Date:02.08.2016

Short description

Verify that:

  • the basic inventory fields apply to each product (assigned to the facility/program)

  • system references facility and program data assigned to the user profile (dependency)

  • user can select 'my facility' or a facility from my supervised facilities (depending on user profile)

  • If user is only associated with 1 facility, this selection should be pre-populated/selected

  • user can select which program (from all programs my facility or supervised facilities serves) to requisition for

  • if a user is only associated with 1 program, program selection to be automatically made

  • "type" is defacto as "regular" for that scheduling period and "emergency" otherwise

  • facility, program and type are required before proceeding

  • the user cannot change his/her assigned facility (if only assigned one)

  • there is a mechanism to 'submit' the requisition

  • there is a mechanism to save the requisition**

  • a requisition can be saved and returned to**

  • upon submission the requisition status changes to "submitted"

  • the selections are easy to make in low-bandwidth environments

  • Stock on hand is calculated during data entry (see formula above)

  • the user can input the quantity for the Beginning Balance (integer)

  • the user can input the quantity for the Total Received Quantity (integer)

  • the user can input the quantity for the Total Losses / Adjustments (+/- integer)

  • the user can input the quantity for the Requested Quantity (integer)

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                       

 

 

Step

Action

Expected system response

Comment

1

 Create a tocken / authentication.

 

 

Method: Post

 

Authentication: enter proper login and password



Status: 200 OK

 

2

Create Geographic Level entity.

Method: Post

Example Body:

{

"code": "1",

"name": "test",

"levelNumber": "1"

}

Status: 201 Created

 

Remember Geographic Level id.

3

Create Geographic Zone entity.

Method: Post

Example Body:

{

"code": "test1",

"name": "test1",

}



Status: 201 Created

Remember Geographic Zone id.

4

Create Facility Type entity.

Method: Post

Example Body:

{

"code": "1",

"name": "test12"

}

Status: 201 Created

Remember Facility Type id.

5

Create first Program entity.

Method: Post

Example Body:

{

"code": "1",

"name": "test13"

}



Status: 201 Created

Remember Program id, it will be used to create supportedPrograms in Facility.

6

Create second Program entity.

Method: Post

Example Body:

{

"code": "2",

"name": "test134"

}

Status: 201 Created

Remember Program id, it will be used to create supportedPrograms in Facility.

7

Create third Program entity.

Method: Post

Example Body:

{

"code": "3",

"name": "test135"

}

Status: 201 Created

Remember Program id, it will be used to change supportedPrograms in Facility.

8

Create Facility entity.

Method: Post

Example Body:

{

"code": "test1",

"active": true,

"enabled": false,

}



Status: 201 Created

Remember id.

9

Create Schedule entity.

Method: Post

Example Body:

{

"code": "test12",

"name": "testowe11"

}

Status: 201 Created

Remember id.

10

Create Period entity.

Method: Post

Example Body:

{

"processingSchedule": {

"id": "8784bcbd-dbf1-4a5f-b15b-833745ce9ade",

"code": "test12",

"name": "testowe11"

},

"name": "testName",

"description": "testDescription",

"startDate": "2016-07-28",

"endDate": "2016-08-05"

}

Status: 201 Created

Remember id.

11

Create productCategory entity.

Method: Post

Example Body:

{

"code":"test1",

"name":"test1234",

"displayOrder":"111222"

}

Status: 201 Created

Remember id.

12

Create product entity.

Method: Post

Example Body:

{

"code":"code12",

"primaryName":"testName",

"dispensingUnit":"testUnit",

"dosesPerDispensingUnit":"3",

"packSize":"4",

"packRoundingThreshold":"3",

"roundToZero":true,

"active":true,

"fullSupply":false,

"tracer":true,

}



Status: 201 Created

Remember id.

13

Create basic Requisition

Method: Post

Example Body:

{

"status": "INITIATED"

}

Status: 201 Created

 

Remember id.

14

Create RequisitionLines.

Method: Post

Example Body:

{

"stockInHand":"1",

"beginningBalance":"1",

"totalReceivedQuantity":"1",

"totalLossesAndAdjustments":"1",

"stockOnHand":"1",

"requestedQuantity":"1",

"totalConsumedQuantity":"1",

"requestedQuantityExplanation":"TEST"

}

Status: 201 Created

Remember id.

15

Create Requisition entity.

Method: Post

Example Body:

{

"emergency":true,

"status":"INITIATED",

}

Status: 201 Created

Remember id.

16

Change RequisitionLines atributes.

Method: Post

Example Body:

{

"id": "914dbd28-f32f-4dc0-95b2-60a8227144de",

"stockInHand":"4",

"beginningBalance":"5",

"totalReceivedQuantity":"6",

"totalLossesAndAdjustments":"5",

"stockOnHand":"8",

"requestedQuantity":"7",

"totalConsumedQuantity":"5",

"requestedQuantityExplanation":"TEST"

}

Status: 201 Created

Remember id.

17

Change supportedPrograms attribute value in Facility.

Method: Post

Example Body:

{

"id":"8b0e1448-1eb8-4959-8333-793949155abc",

"code": "test1",

"active": true,

"enabled": false,

}



Status: 201 Created

Remember id.

18

Test following endpoint:

URL: /localhost:8080/api/requisitions/009bbcbe-0cc5-4ed4-9f43-587677d830da/submit?access_token=c098cc8c-c10c-43ca-bd67-591dfb14548d

Method: Post

Example Body:

{

"id":"c9d9d880-d2e9-4010-821d-2e454f7bcc65",

"facility":{"id":"d225ab0c-c8bf-44be-a16e-c1a54dca217b"},

"program":{"id":"0aac4707-5681-416f-be2c-c7419a2e4045"},

"processingPeriod":{"id":"6c2f5773-41b6-43d6-af4d-0c7688f36993"},

"emergency":true,

"status":"INITIATED",

"requisitionLines":[

{

"id":"30239766-275d-4e11-99d4-e7d9c4568e93",

"product":{"id":"43218a96-432e-489d-aa5c-fa20d82e0d1a"},

"requisition":{"id":"009bbcbe-0cc5-4ed4-9f43-587677d830da"},

 "stockInHand":"1",

  "beginningBalance":"1",

  "totalReceivedQuantity":"1",

  "totalLossesAndAdjustments":"1",

  "stockOnHand":"1",

  "requestedQuantity":"1",

  "totalConsumedQuantity":"1",

  "requestedQuantityExplanation":"BOTAK"

}

]

}



{

"id":"6a6dbf7b-395c-4c64-bb84-b5102f673a40",

"product":{"id":"0638b9b0-56c5-499c-9ee7-d83721549f5f"},

"requisition":{"id":"56110ac0-ab62-4507-b507-359cec932670"},

"stockInHand":"1",

"beginningBalance":"1",

"totalReceivedQuantity":"1",

"totalLossesAndAdjustments":"1",

"stockOnHand":"1",

"requestedQuantity":"1",

"totalConsumedQuantity":"1",

"requestedQuantityExplanation":"TEST"

}

]

}

Status 200 OK

 

 

 

19

 

 

 

 

Post – conditions:

                                                                                                                   

OpenLMIS: the global initiative for powerful LMIS software