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:
|
|
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", "geographicZone": "http://localhost:8080/api/geographicZones/597d6974-28fc-4049-9210-d8438ce41dc1", "active": true, "enabled": false, "supportedPrograms":["http://localhost:8080/api/programs/27a0a233-3639-467d-a582-4b45e3ecd4ee","http://localhost:8080/api/programs/97f28dc1-885f-49c1-adc0-27032d8f1191"] } | 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, "productCategory":"http://localhost:8080/api/productCategories/3e97f98b-90ed-457d-b99d-ccac49f47753" } | Status: 201 Created | Remember id. |
13 | Create basic Requisition Method: Post Example Body: { "processingPeriod": "http://localhost:8080/api/periods/ebfc7c6b-4b0a-413f-acef-491952122d12", "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: { "processingPeriod":"http://localhost:8080/api/periods/ebfc7c6b-4b0a-413f-acef-491952122d12", "emergency":true, "status":"INITIATED", "requisitionLines":["http://localhost:8080/api/requisitionLines/6a6dbf7b-395c-4c64-bb84-b5102f673a40"] } | 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", "geographicZone": "http://localhost:8080/api/geographicZones/597d6974-28fc-4049-9210-d8438ce41dc1", "active": true, "enabled": false, "supportedPrograms":["http://localhost:8080/api/programs/97f28dc1-885f-49c1-adc0-27032d8f1191","http://localhost:8080/api/programs/18e1c25b-dce4-4c81-bcdc-e77af2db2d9f"] } | 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