OLMIS-807 : Submit requisition only if quantity entered.

Test Case #805

Test Case Name: Submit requisition only if quantity entered.

System: OpenLMIS

Subsystem:Requisition

Test case designed by: Piotr Żurawski

Design Date:25.07.2016

Short description: Check possibility to Submit requisition when quantity is/is not entered.

                                                                                                                                                   

Pre – conditions:

  1. Create Program by Postman.

    URL: http://localhost:8080/api/programs

    Method: POST

    Request:

    {

    "code":"programCodee"

    }

  2. Create geographic Levels by Postman.

    URL: http://localhost:8080/api/geographicLevels

    Method: POST

    Request:

    {

    "code":"geoLevelCode",

    "levelNumber":200

    }

  3. Create geographic Zones by Postman.

    URL: http://localhost:8080/api/geographicZones

    Method: POST

    Request:

    {

    "code":"geoZonesLeve;",

    "level":"http://localhost:8080/api/geographicLevels/6583a4a1-74e8-46ef-a032-305efb1f1758"

    }

  4. Create facility Types by Postman.

    URL: http://localhost:8080/api/facilityTypes

    Method: POST

    Request:

    {

    "code":"facilityTypeCode"

    }

  5. Create facilities by Postman.

    URL: http://localhost:8080/api/facilities

    Method: POST

    Request:

    {
    "code": "facilityCode",
    "geographicZone":"http://localhost:8080/api/geographicZones/70b50073-c4d1-4f49-95c9-aa69907952e2",
    "type":"http://localhost:8080/api/facilityTypes/3a04f48c-9967-4de1-b57c-2efa9b523004",
    "active":false,
    "enabled":false
    }

  6. Create schedules by Postman.

    URL: http://localhost:8080/api/schedules

    Method: POST

    Request:

    Request:

    {

    "code":"schedulesCode",

    "name":"schedulesName"

    }

     

    Response:

    {

    "code": "schedulesCode",

    "description": null,

    "modifiedDate": "2016-07-15T09:49:55.731",

    "name": "schedulesName",

    "_links": {

    "self": {

    "href": "http://localhost:8080/api/schedules/88f88d31-aecf-42a2-85cd-33a6b96df05d"

    },

    "schedule": {

    "href": "http://localhost:8080/api/schedules/88f88d31-aecf-42a2-85cd-33a6b96df05d"

    }

    }

  7. Create periods by Postman.

    URL: http://localhost:8080/api/users

    Method: POST

    Request:

    Request:

    {

    "processingSchedule":

    {

    "id": "88f88d31-aecf-42a2-85cd-33a6b96df05d",

    "code": "schedulesCode",

    "description": null,

    "modifiedDate": "2016-07-15T09:49:55.731",

    "name": "schedulesName"

    },

    "name":"periodName",

    "description":"periodDescription",

    "startDate":"2016-07-11",

    "endDate":"2016-07-12"

    }

  8. Create requsitions by Postman.

    URL: http://localhost:8080/api/users

    Method: POST

    Request:

    Request:

    {

    "facility":"http://localhost:8080/api/facilities/f4a567a3-ec0f-4f4e-b13f-75fb1e9a0154",

    "program":"http://localhost:8080/api/programs/4b81fa87-5df9-4001-86c5-c3d5ccb9897e",

    "processingPeriod":"http://localhost:8080/api/periods/7fc68a7e-0b6e-41fc-b759-120c46098b66",

    "status":"SUBMITTED"

    }

  9. Create products by Postman.

    URL: http://localhost:8080/api/users

    Method: POST

    Request:

    Request:

    {

    "code":"productCode",

    "primaryName":"productPrimaryName",

    "dispensingUnit":"something",

    "dosesPerDispensingUnit":12345,

    "packSize":1234,

    "packRoundingThreshold":123,

    "roundToZero":false,

    "active":false,

    "fullSupply":false,

    "tracer":false

    }

  10. Create requsitionLines by Postman.

    URL: http://localhost:8080/api/users

    Method: POST

    Request:

    Request:

    {

    "product":"http://localhost:8080/api/products/8b47ab9b-44cf-46a6-85cd-67805d5e888a"

    }

     

    Response:

    {

    "quantityRequested": null,

    "_links": {

    "self": {

    "href": "http://localhost:8080/api/requisitionLines/24ae0f56-0a83-4743-bd4f-647e5d3db6b6"

    },

    "requisitionLine": {

    "href": "http://localhost:8080/api/requisitionLines/24ae0f56-0a83-4743-bd4f-647e5d3db6b6"

    },

    "product": {

    "href": "http://localhost:8080/api/requisitionLines/24ae0f56-0a83-4743-bd4f-647e5d3db6b6/product"

    }

    }

    }

 

 

Step

Action

Expected system response

Comment

1

Submit should not accept json without given quantityRequested value.

URL: http://localhost:8080/api/requisitions/submit

Method: POST

Body:

{

"id":"154f448d-a18c-44b6-8ac9-930ad9f72503",

"createdDate":"2016-07-14T12:13:09.214",

"requisitionLines":[

{

"id":"24ae0f56-0a83-4743-bd4f-647e5d3db6b6",

"quantityRequested":null,

"product":{

"id":"8b47ab9b-44cf-46a6-85cd-67805d5e888a",

"code":"proCode",

"primaryName":"primCode",

"dispensingUnit":"asdfsaf",

"dosesPerDispensingUnit":131312,

"packSize":123131,

"packRoundingThreshold":1231,

"roundToZero":false,

"active":false,

"fullSupply":false,

"tracer":false

},

"requisition":{

"id":"154f448d-a18c-44b6-8ac9-930ad9f72503"

}

}

],

"facility":{

"id":"f4a567a3-ec0f-4f4e-b13f-75fb1e9a0154",

"code":"facilityCode",

"name":null,

"description":null,

"active":false,

"goLiveDate":null,

"goDownDate":null,

"comment":null,

"enabled":false,

"type":{

"id":"35987c94-f8a5-48e3-af5f-b9276749a7a2",

"code":"facilityTypeCode"

},

"geographicZone":{

"id":"a8d6807b-87ac-4166-a53e-eaef5d8a5acc",

"code":"geoZonesLeve;",

"level":{

"id":"4cbbf1be-8806-4361-b821-b1019f50d959",

"code":"geoLevelCode",

"name":null,

"levelNumber":200

}

}

},

"program":{

"id":"4b81fa87-5df9-4001-86c5-c3d5ccb9897e",

"code":"programsCode",

"name":null,

"description":null,

"active":null,

"skippable":false,

"showNonFullSupplyTab":null

},

"processingPeriod":{

"id":"7fc68a7e-0b6e-41fc-b759-120c46098b66",

"name":"periodName",

"description":"periodDescription",

"startDate":"2016-07-11",

"endDate":"2016-07-12",

"processingSchedule":{

"id":"95bdb8da-89c6-4e06-85aa-94d668ecceab",

"code":"schedulesCode",

"description":null,

"modifiedDate":"2016-07-14T12:10:44.575",

"name":"schedulesName"

}

}

}


 
2

Possibility to Submit requsistion with given quantityRequested.

URL: http://localhost:8080/api/requisitions/submit

Method: POST

Body:

{

"id":"154f448d-a18c-44b6-8ac9-930ad9f72503",

"createdDate":"2016-07-14T12:13:09.214",

"requisitionLines":[

{

"id":"24ae0f56-0a83-4743-bd4f-647e5d3db6b6",

"quantityRequested":12,

"product":{

"id":"8b47ab9b-44cf-46a6-85cd-67805d5e888a",

"code":"proCode",

"primaryName":"primCode",

"dispensingUnit":"asdfsaf",

"dosesPerDispensingUnit":131312,

"packSize":123131,

"packRoundingThreshold":1231,

"roundToZero":false,

"active":false,

"fullSupply":false,

"tracer":false

},

"requisition":{

"id":"154f448d-a18c-44b6-8ac9-930ad9f72503"

}

}

],

"facility":{

"id":"f4a567a3-ec0f-4f4e-b13f-75fb1e9a0154",

"code":"facilityCode",

"name":null,

"description":null,

"active":false,

"goLiveDate":null,

"goDownDate":null,

"comment":null,

"enabled":false,

"type":{

"id":"35987c94-f8a5-48e3-af5f-b9276749a7a2",

"code":"facilityTypeCode"

},

"geographicZone":{

"id":"a8d6807b-87ac-4166-a53e-eaef5d8a5acc",

"code":"geoZonesLeve;",

"level":{

"id":"4cbbf1be-8806-4361-b821-b1019f50d959",

"code":"geoLevelCode",

"name":null,

"levelNumber":200

}

}

},

"program":{

"id":"4b81fa87-5df9-4001-86c5-c3d5ccb9897e",

"code":"programsCode",

"name":null,

"description":null,

"active":null,

"skippable":false,

"showNonFullSupplyTab":null

},

"processingPeriod":{

"id":"7fc68a7e-0b6e-41fc-b759-120c46098b66",

"name":"periodName",

"description":"periodDescription",

"startDate":"2016-07-11",

"endDate":"2016-07-12",

"processingSchedule":{

"id":"95bdb8da-89c6-4e06-85aa-94d668ecceab",

"code":"schedulesCode",

"description":null,

"modifiedDate":"2016-07-14T12:10:44.575",

"name":"schedulesName"

}

}

}


 

Post – conditions:        

 


OpenLMIS: the global initiative for powerful LMIS software