642: Authorize a requisition
Test Case #:642
| Test Case Name: Authorize a requisition |
System: OpenLMIS | Subsystem: requisition |
Test case designed by: Lucyna Kwidzinska | Design Date:04.08.2016 |
Short description: Possibility to authorize a requisition created at facility (before sending it on for approval at a higher level), So that I can delegate responsibility for creating the requisition while still having a final review before the requisition is submitted.
|
|
Pre – conditions: |
|
Step | Action | Expected system response | Comment |
1 | Create FacilityType. Method: POST Example body: { "code": "typecode01", "name": "namecode01", "displayOrder": "12" } | status: 201 created is returned,
|
|
2 | Create geographicLevel. Method: POST, Example body: { "code": "levelcode01", "name": "levelname01", "levelNumber": "32" } | status: 201 created is returned, |
|
3 | Create geographicZone. Method: POST Example body: { "code": "zonecode01", "name": "zonename01", } | status: 201 created is returned,
|
|
4 | Create Facility. Method: POST
Example body: { "code": "facilitycode01", "name": "facilityname01", "geographicZone": "http://localhost:8080/api/geographicZones/997164ca-276f-4acf-aace-7704b9f5c3c0", "enabled": "true", "active": "true" } | status: 201 created is returned, |
|
5 | Create Program. Method: POST Example body: { "code": "programcode01", "name": "programname01", "periodsSkippable": "true" } | status: 201 created is returned, |
|
6 | Create Schedule. Method: POST Example body: { "code": "schedulecode01", "name": "schedulename01" } | status: 201 created is returned,
|
|
7 | Create Period. Method: POST Example body: { "processingSchedule": { "id": "97c91bd4-8021-4c17-92fe-a9eb183a4900", "code": "schedulecode01", "name": "schedulename01" }, "name": "periodname01", "startDate": "2016-08-05", "endDate": "2016-08-08" } | status: 201 created is returned, |
|
8 | Create ProductCategory. Method: POST, Example body: { "code": "codecategory01", "name": "namecategory01", "displayOrder": "7" } | status: 201 created is returned,
|
|
9 | Create Product. Method: POST, URL: Example body: { "code": "productcode1", "primaryName": "name1", "dispensingUnit": "unit1", "dosesPerDispensingUnit": "1", "packSize": "1", "packRoundingThreshold": "1", "roundToZero": "true", "active": "true", "fullSupply": "true", "tracer": "true", "productCategory":"http://localhost:8080/api/productCategories/613ae329-49df-4740-a246-b432c43c0374" } | status: 201 created is returned, |
|
10 | Create Requisition with SUBMITTED status. Method: POST, URL: Example body: { "processingPeriod": "http://localhost:8080/api/periods/539a0d88-19ae-4831-b552-61923034d5a4", "status": "SUBMITTED" } | status: 201 created is returned, |
|
11 | Verify the possibility of AUTHORIZE the previously created requisition. Endpoint: /requisitions/{id}/authorize/?access_token=token METHOD: PUT Example URL: Example body: { "id": "f716cc84-99b0-4e2a-be01-2e2011f53def", "createdDate": "2016-08-04T14:13:09.214", "facility": { "id": "3952bb2f-b4b9-4695-9902-3e27c8bd7c0c", "code": "facilitycode01", "name": "facilityname01", "description": null, "operator": null, "goLiveDate": null, "goDownDate": null, "comment": null, "openLmisAccessible": null,
"geographicZone": { "id": "997164ca-276f-4acf-aace-7704b9f5c3c0", "code": "zonecode01", "name": "zonename01", "cathmentPopulation": null, "latitude": null, "londitude": null, "level": { "id": "a2476611-aebf-4380-8da5-7abbeb61e506", "code": "levelcode01", "name": "levelname01", "levelNumber": "32" }
}, "type": { "id": "dd54504e-cd0d-41b3-b16b-cf8a94793973", "code": "typecode01", "name": "namecode01", "displayOrder": "12", "description": null, "active": null }
, "enabled": "true", "active": "true" }, "program": { "id": "3610f565-fc4e-4b6a-a4ed-17845fbd19da", "code": "programcode01", "name": "programname01", "periodsSkippable": "true", "description": null, "active": null, "showNonFullSupplyTab": null }
, "processingPeriod": { "id": "539a0d88-19ae-4831-b552-61923034d5a4", "processingSchedule": { "id": "97c91bd4-8021-4c17-92fe-a9eb183a4900", "code": "schedulecode01", "description": null, "modifiedDate": null, "name": "schedulename01" }
, "name": "periodname01", "description": null, "startDate": "2016-08-05", "endDate": "2016-08-08" }, "status": "SUBMITTED", "emergency": "true", "remarks": "abc",
"requisitionLines": [{ "product": { "id": "ad13d942-777d-4c02-825e-e8478bd1fb02", "code": "productcode1", "primaryName": "name1", "dispensingUnit": "unit1", "dosesPerDispensingUnit": "1", "packSize": "1", "packRoundingThreshold": "1", "roundToZero": "true", "active": "true", "fullSupply": "true", "tracer": "true", "productCategory": { "id": "613ae329-49df-4740-a246-b432c43c0374", "code": "codecategory01", "name": "namecategory01", "displayOrder": "7" }
}, "requisition": { "id":"f716cc84-99b0-4e2a-be01-2e2011f53def" }, "stockInHand": "2", "beginningBalance": "2", "totalReceivedQuantity": "2", "totalLossesAndAdjustments": "2", "stockOnHand": "2", "requestedQuantity": "2", "totalConsumedQuantity": "2", "requestedQuantityExplanation": "2" }] } | status: 200 OK is returned. The status of requisition should be changed to AUTHORIZED.
|
|
12 | Verify the possibility of view the authorized requisition. Method: GET Example URL: | status: 200 OK is returned. |
|
Post – conditions: |
OpenLMIS: the global initiative for powerful LMIS software