641: Ability to View Past Filled Orders

Test Case #: 641

 

Test Case Name: Ability to view past filled orders

System: OpenLMIS

Subsystem: requisition

Test case designed by: Lucyna Kwidzińska

Design Date:02.08.2016

Short description: Possiblity to view a list of all orders that have been filled by facility so that I have a record of how I have filled past orders.

Acceptance Criteria:
1. All completed orders processed by my facility show up in the list
2. Both requested quantity and filled quantity
2. Ability to optionally filter by program, ordering facility, schedule, year, and period
3. Ability to download a CSV or PDF version of each completed order

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                       

 

 

Step

Action

Expected system response

Comment

1

Create User.    

URL: http://localhost:8080/api/users/?access_token=17150cea-d2fa-4315-80d9-e3eaa4159399

Method: POST

Example Body:

{

"username": "testowy01",

"password": "test1234",

"firstName": "firsttest01",

"lastName": "lasttest01",

"verified": "true",

"active": "true"

}

   

 status: 201 created is returned,

user id: "http://localhost:8080/api/users/af293653-797d-4b79-983e-bb45175d15ad"

                               

                                                 

2

Create program.

URL: http://localhost:8080/api/programs/?access_token=17150cea-d2fa-4315-80d9-e3eaa4159399

Method: POST

Example Body:

{

"code": "codeprogram01",

"periodSkippable": "true"

}

 status: 201 created is returned,

program id: "http://localhost:8080/api/programs/a297e097-5a4a-49f3-ad36-97f762228507"

 

 

3

Create facilityType.

URL: http://localhost:8080/api/facilityTypes/?access_token=17150cea-d2fa-4315-80d9-e3eaa4159399

Method: POST

Example Body:

{

"code": "facilitypecode01"

}

 status: 201 created is returned,

facilityType id: "http://localhost:8080/api/facilityTypes/240d312e-c872-46df-b591-0ad9103dad5e"

 

4

Create geographicLevel

URL: http://localhost:8080/api/geographicLevels?access_token=17150cea-d2fa-4315-80d9-e3eaa4159399

Method: POST

Example Body:

{

"code": "geolevelcode01",

"levelNumber": "21"

}

status: 201 created is returned,

geographicLevel id: "http://localhost:8080/api/geographicLevels/56a2bb98-06ae-4278-8b0e-ec1822697602"

 

5

Create geographicZone.

URL: http://localhost:8080/api/geographicZones/?access_token=17150cea-d2fa-4315-80d9-e3eaa4159399

Method: POST

Example Body:

{

"code": "zonecode01",

"name": "namezone01",

"level": "http://localhost:8080/api/geographicLevels/56a2bb98-06ae-4278-8b0e-ec1822697602"

}

status: 201 created is returned,

geographicZone id: "http://localhost:8080/api/geographicZones/a7adb69e-8a82-4c4e-8ff5-7bb17e1ff193"

 

6

Create Facility.

URL: http://localhost:8080/api/facilities/?access_token=17150cea-d2fa-4315-80d9-e3eaa4159399

Method: POST

Example Body:

{

"code": "facilitycode01",

"geographicZone": "http://localhost:8080/api/geographicZones/a7adb69e-8a82-4c4e-8ff5-7bb17e1ff193",

"type": "http://localhost:8080/api/facilityTypes/240d312e-c872-46df-b591-0ad9103dad5e",

"active": "true",

"enabled": "true"

}

 

7

Create Schedule.

URL: http://localhost:8080/api/schedules/?access_token=17150cea-d2fa-4315-80d9-e3eaa4159399

Method:

Example body:

{

"code": "schedulecode01",

"name": "schedulename01"

}

 

8

                    

Create Period.

URL: http://localhost:8080/api/periods/?access_token=17150cea-d2fa-4315-80d9-e3eaa4159399

Method: POST

Example body:

{

"processingSchedule": {

"id": "ed2ced44-1501-4194-a3b3-216e7fa7510a",

"code": "schedulecode01",

"name": "schedulename01"

},

"name": "periodname01",

"description": "abcperiod01",

"startDate": "2016-08-01",

"endDate": "2016-08-05"

}

                            

 

9

Create ProductCategory

URL: http://localhost:8080/api/productCategories/?access_token=17150cea-d2fa-4315-80d9-e3eaa4159399

Method: POST

 Example body:

{

"code": "codecategory",

"name": "namecategory",

"displayOrder": "18"

}

status: 201 created is returned,

productCategories id: "http://localhost:8080/api/productCategories/f293ab0f-3c86-413e-acb3-cf2b69d51088"

 
10

Create product.

URL: http://localhost:8080/api/products/?access_token=17150cea-d2fa-4315-80d9-e3eaa4159399

Method: POST

 Example body:

{

"code": "codetestcode",

"primaryName": "producttestname",

"dispensingUnit": "abc",

"dosesPerDispensingUnit": "1",

"packSize": "1",

"packRoundingThreshold": "1",

"roundToZero": "true",

"active": "true",

"fullSupply": "true",

"tracer": "true",

"productCategory": "http://localhost:8080/api/productCategories/f293ab0f-3c86-413e-acb3-cf2b69d51088"

}

 
11

Create requisition.

URL: http://localhost:8080/api/requisitions/?access_token=17150cea-d2fa-4315-80d9-e3eaa4159399

Method: POST

Example body:

{

"facility": "http://localhost:8080/api/facilities/53994e07-61f3-48a2-9e7a-13b17db33eea",

"program": "http://localhost:8080/api/programs/a297e097-5a4a-49f3-ad36-97f762228507",

"processingPeriod": "http://localhost:8080/api/periods/98145211-2703-4bff-aa77-83596c0f3b1d",

"status": "SUBMITTED"

}

status: 201 created is returned,

requisition id: "http://localhost:8080/api/requisitions/2f6c847b-3b61-4656-a954-c2f642f731a3"

 
12

Create Order.

URL: http://localhost:8080/api/orders/?access_token=17150cea-d2fa-4315-80d9-e3eaa4159399

Method: POST

Example Body:

{

"requisition": "http://localhost:8080/api/requisitions/2f6c847b-3b61-4656-a954-c2f642f731a3",

"createdBy": "http://localhost:8080/api/users/af293653-797d-4b79-983e-bb45175d15ad",

"program": "http://localhost:8080/api/programs/a297e097-5a4a-49f3-ad36-97f762228507",

"requestingFacility": "http://localhost:8080/api/facilities/53994e07-61f3-48a2-9e7a-13b17db33eea",

"receivingFacility": "http://localhost:8080/api/facilities/53994e07-61f3-48a2-9e7a-13b17db33eea",

"supplyingFacility": "http://localhost:8080/api/facilities/53994e07-61f3-48a2-9e7a-13b17db33eea",

"orderCode": "order0123",

"status": "ORDERED",

"quotedCost": "1234.123"

}

status: 201 created is returned,

order id: "http://localhost:8080/api/orders/e13e0e4f-05f7-4eaa-aad8-66cfe3fc3808"

 

 
13

Create OrderLine.

URL: http://localhost:8080/api/orderLines/?access_token=17150cea-d2fa-4315-80d9-e3eaa4159399

Method: POST

Example Body:

{

"order": "http://localhost:8080/api/orders/e13e0e4f-05f7-4eaa-aad8-66cfe3fc3808",

"product": "http://localhost:8080/api/products/93f1ade6-6d1a-4aec-b101-19cc3b0ca4e6",

"orderedQuantity": "1",

"filledQuantity": "1",

"batch": "testbatch",

"expiryDate": "2016-08-10",

"vvm": "testvvm",

"manufacturer": "testmanufacturer"

}

 
14

Ability to optionally filter by program, ordering facility, schedule, year, and period

a) endpoint: http://localhost:8080/api/facilities/id/orders/

b) Method: GET

c) Example URL:

http://localhost:8080/api/facilities/53994e07-61f3-48a2-9e7a-13b17db33eea/orders?programId=a297e097-5a4a-49f3-ad36-97f762228507?requestingFacilityId=53994e07-61f3-48a2-9e7a-13b17db33eea?periodId=98145211-2703-4bff-aa77-83596c0f3b1d?scheduleId=ed2ced44-1501-4194-a3b3-216e7fa7510a?startDate=2016-08-01?endDate=2016-08-05&access_token=17150cea-d2fa-4315-80d9-e3eaa4159399


 

status: 200 OK is returned,

 

the {id} in the request is the id of facility

15

Ability to download a CSV of each completed order

a) endpoint: http://localhost:8080/api/orders/id/print

b) Method: GET

c) Example URL:

http://localhost:8080/api/orders/e13e0e4f-05f7-4eaa-aad8-66cfe3fc3808/print?format=csv&access_token=17150cea-d2fa-4315-80d9-e3eaa4159399

status: 200 OK is returned,

the {id} in the request is the id of previously created order
16

Ability to download a PDF version of each completed order

a) endpoint: http://localhost:8080/api/orders/id/print/

b) Method: GET

c) Example URL:

http://localhost:8080/api/orders/e13e0e4f-05f7-4eaa-aad8-66cfe3fc3808/print?format=pdf&access_token=17150cea-d2fa-4315-80d9-e3eaa4159399


System should ask user where to save a .pdf file. When user opens the downloaded .pdf file, it should contains the details of completed order.

 

 

 

 

Post – conditions:

OpenLMIS: the global initiative for powerful LMIS software