Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Step

Action

Expected system response

Comment

1

        Generate the token for authentication.              

      Token is generated.     

   

                                                 

2

Create FacilityType

URL: http://localhost:8080/api/facilityTypes/?access_token=804fd76a-4056-4b65-9aed-8ddbbbabb738

 

Example body:

{

"code": "typecode",

"name": "typename",

"displayOrder": "3"

}

 

 

 

status 201 created is returned,

 id:

"http://localhost:8080/api/facilityTypes/6c04d346e7b8c843-3890307a-440f4d24-84f49640-400ebd1522866de34df1cb47"

 

Image Added

 

3

Create geographicZone

 

URL: http://localhost:8080/api/geographicZones/?access_token=804fd76a-4056-4b65-9aed-8ddbbbabb738

Example body:

{

"code": "geolcode",

"name": "geoname",

"level": "http://localhost:8080/api/geographicLevels/1f168007-f639-40ab-b221-fe82a8959199"

}

 

status 201 created is returned,

id:

"http://localhost:8080/api/geographicZones/0e68bc8bb0e62722-b15e7ac9-473c4570-bb5b87ee-3e1e895843d1ec67fdc29751"

 

Image Added

 

4

Create geographicLevel

 

URL: http://localhost:8080/api/geographicLevels/?access_token=804fd76a-4056-4b65-9aed-8ddbbbabb738

Example body:

{

"code": "levelcode",

"name": "levelname",

"levelNumber": "3"

}

 

status 201 created is returned,

id:

"http://localhost:8080/api/geographicLevels/1f16800799e9c2c4-f63951e1-40ab4704-b2218b84-fe82a8959199ce93734b13fe"

 

Image Added

 

5

Create Facility

 

URL: http://localhost:8080/api/facilities/?access_token=804fd76a-4056-4b65-9aed-8ddbbbabb738

Example body:

{

"code": "facilitycode",

"name": "facilityname",

"geographicZone": "http://localhost:8080/api/geographicZones/0e68bc8bb0e62722-b15e7ac9-473c4570-bb5b87ee-3e1e895843d1ec67fdc29751",

"type": "http://localhost:8080/api/facilityTypes/6c04d346e7b8c843-3890307a-440f4d24-84f49640-400ebd1522866de34df1cb47",

"active": "true",

"enabled": "true"

}


 
status 201 created is returned, 

id:

"http://localhost:8080/api/facilities/

c73da19c2e0f4a53b1a83c30ae89b276Image Added

 

6

Create User

 

URL: http://localhost:8080/api/users/?access_token=804fd76a-4056-4b65-9aed-8ddbbbabb738

Example body:

{

"username": "test","password": "test123",

"firstName": "test1",

"lastName": "test2",

"verified": true,

"active": true

}

 
status 201 created is returned, 

id: "http://localhost:8080/api/users/a5b648858957ffba-c3a6bc9c-4cf64960-a5e2a4e5-b61266beceda31ef05a77fd0"

 

7

Create Program

 

URL: http://localhost:8080/api/programs?access_token=804fd76a-4056-4b65-9aed-8ddbbbabb738

Example body:

{

"code": "programcode",

"name": "programname",

"description": "abc",

"periodsSkippable": true

 

}

 
status 201 created is returned, 

id:

"http://localhost:8080/api/programs/

810ec172e42845abbb8baae571bee304Image Added

 

8

Create Schedule

 

URL: http://localhost:8080/api/schedules/?access_token=804fd76a-4056-4b65-9aed-8ddbbbabb738

Example body:

{

"code": "schedulemcode",

"name": "schedulename"

 

}

status 201 created is returned,

id:

"http://localhost:8080/api/schedules/

63bcbc3d96ac497fa1d43fe8ae8f3546

266d6bfcb531"

Image Added

 
9

Create Period

 

URL: http://localhost:8080/api/periods/?access_token=804fd76a-4056-4b65-9aed-8ddbbbabb738

Example body:

{

"processingSchedule": {

"id": "63bcbc3db0f63d5a-96ac1815-497f405d-a1d492ef-3fe8ae8f3546266d6bfcb531",

"code": "schedulemcode",

"name": "schedulename"

},

"name": "periodname",

"startDate": "2016-08-25",

"endDate": "2016-09-25"

 

 

}

status 201 created is returned,

id: "http://localhost:8080/api/periods/

bbe93b33

4878678f-

1f6c

fdc0-

4a35

4a75-

a739

a0b2-

075b310c7a2b

55f143241c0d"

 

Image Added

 

10

                        

Create requisition

URL: http://localhost:8080/api/requisitions/?access_token=804fd76a-4056-4b65-9aed-8ddbbbabb738

Example body:

{

"facility": "http://localhost:8080/api/facilities/c73da19cb8e6ef2a-2e0f91c7-4a534558-b1a8b538-3c30ae89b276168d59c734b2",

"program": "http://localhost:8080/api/programs/810ec172ccae21eb-e4280e99-45ab4148-bb8bad39-aae571bee304df2b2af9dae4",

"processingPeriod": "http://localhost:8080/api/periods/bbe93b334878678f-1f6cfdc0-4a354a75-a739a0b2-075b310c7a2b55f143241c0d",

"status": "SUBMITTED"

 

}


                        
status 201 created is returned, 

id:

"http://localhost:8080/api/requisitions/f3fa21d4ed937580-2cb1e74d-48c044a2-a57fb3c8-73d7684539522e54216003a6"Image Added

 

 

 

11

Create Order

 

URL: http://localhost:8080/api/orders/?access_token=804fd76a-4056-4b65-9aed-8ddbbbabb738

Example body:

{

"requisition": "http://localhost:8080/api/requisitions/f3fa21d4ed937580-2cb1e74d-48c044a2-a57fb3c8-73d7684539522e54216003a6",

"createdBy": "http://localhost:8080/api/users/a5b648858957ffba-c3a6bc9c-4cf64960-a5e2a4e5-b61266beceda31ef05a77fd0",

"program": "http://localhost:8080/api/programs/810ec172ccae21eb-e4280e99-45ab4148-bb8bad39-aae571bee304df2b2af9dae4",

"requestingFacility": "http://localhost:8080/api/facilities/c73da19cb8e6ef2a-2e0f91c7-4a534558-b1a8b538-3c30ae89b276168d59c734b2",

"receivingFacility": "http://localhost:8080/api/facilities/c73da19cb8e6ef2a-2e0f91c7-4a534558-b1a8b538-3c30ae89b276168d59c734b2",

"supplyingFacility": "http://localhost:8080/api/facilities/c73da19cb8e6ef2a-2e0f91c7-4a534558-b1a8b538-3c30ae89b276168d59c734b2",

"orderCode": "code1234",

"status": "ORDERED",

"quotedCost": "123.123456"

}

status 201 created is returned,

id:

"http://localhost:8080/api/orders/

16889820febe4699bc92b0d3f6504f2b

4d36f9518653"

Image Added

 
12

Create productCategory

URL: http://localhost:8080/api/productCategories/?access_token=804fd76a-4056-4b65-9aed-8ddbbbabb738

Example body:

{

"code": "categorycode",

"name": "categoryname",

"displayOrder": "44"

}

status 201 created is returned,

id:

"http://localhost:8080/api/productCategories/

8f7c42e9e33a409086c72824564391d8Image Added
 
13

Create Product

URL: http://localhost:8080/api/products/?access_token=804fd76a-4056-4b65-9aed-8ddbbbabb738

Example body:

{

"code": "productcode",

"primaryName": "productname1",

"dispensingUnit": "unit34",

"dosesPerDispensingUnit": "4",

"packSize": "4",

"packRoundingThreshold": "4",

"roundToZero": true,

"active": true,

"fullSupply": true,

"tracer": true,

"productCategory":

"http://localhost:8080/api/productCategories/8f7c42e9be58b5d5-e33aaada-4090429d-86c7bec3-2824564391d88db02c609d60"

}

Image Added

status 201 created is returned,

id:

"http://localhost:8080/api/products/

e849ef39dd234f73b9838c4b7577bb3f
 
14

Create OrderLine

URL: http://localhost:8080/api/orderLines/?access_token=804fd76a-4056-4b65-9aed-8ddbbbabb738

Example body:

{

"order": "http://localhost:8080/api/orders/16889820-febe-4699-bc92-b0d3f6504f2b",

"product": "http://localhost:8080/api/products/e849ef39-dd23-4f73-b983-8c4b7577bb3f",

"orderedQuantity": "12",

"filledQuantity": "12"

}

status 201 created is returned,

id:

"http://localhost:8080/api/orderLines/27bf241f0c7f60e7-9e806e86-426a4dfc-8e91b793-86e6a7e398e3861b4fb23a86"

 
15

Create ProofOfDelivery

URL: http://localhost:8080/api/proofOfDeliveries/?access_token=804fd76a-4056-4b65-9aed-8ddbbbabb738

Example body:

{

"order":

"http://localhost:8080/api/orders/1688982097461ccc-febe4701-46994701-bc92b5b4-b0d3f6504f2b4d36f9518653",

"totalShippedPacks": 2,

"totalReceivedPacks": 2,

"totalReturnedPacks": 2,

"deliveredBy": "testuser",

"receivedBy": "testureceiver",

"receivedData": "2016-08-26"

 

}

 

 

 

status 201 created is returned,

id:

"http://localhost:8080/api/proofOfDeliveries/

b49e860a955944229adf50ab106e7014

06fa91a2a3b6"

Image Added
 
16

Create printProofOfDeliveryLine

URL: http://localhost:8080/api/proofOfDeliveryLines/?access_token=804fd76a-4056-4b65-9aed-8ddbbbabb738

Example body:

{

"orderLine":

"http://localhost:8080/api/orderLines/27bf241f0c7f60e7-9e806e86-426a4dfc-8e91b793-86e6a7e398e3861b4fb23a86",

"proofOfDelivery":

"http://localhost:8080/api/proofOfDeliveries/b49e860ab4386e94-9559df0e-44224568-9adf8320-50ab106e701406fa91a2a3b6",

"packToShip": 2,

"quantityShipped": 2,

"quantityReceived": 2,

"quantityReturned": 0,

"notes": "somenotes"

 

}

status 201 created is returned,

id:

 "8fe0b96e4b2a4d778f489df886faf499

7ad222c4b542"

Image Added

  
17

Create the another printProofOfDeliveryLine ProofOfDeliveryLine with another orderLine

URL: http://localhost:8080/api/proofOfDeliveryLines/?access_token=804fd76a-4056-4b65-9aed-8ddbbbabb738

Example body:

{

"orderLine":

"http://localhost:8080/api/orderLines/

429199d1

9abe0c32-

b262

e5d5-

40eb

477a-

98fb

a6ef-

8740cf4813cd

6a52721f012c",

"proofOfDelivery":

"http://localhost:8080/api/proofOfDeliveries/

b49e860a

b4386e94-

9559

df0e-

4422

4568-

9adf

8320-

50ab106e7014

06fa91a2a3b6",

"packToShip": 2,

"quantityShipped": 2,

"quantityReceived": 2,

"quantityReturned": 0,

"notes": "somenotes"

 

}

 

the second orderLine must contain the other product and productCategory (the creation process is described in points 12-14).
1718

Adding Add report PDF template:

URL:

http://localhost:8080/api/templates?access_token=fb4ebbfc-2ef2-40e7-8ee9-ccdfa508487f

Method: POST

Body (form-data):

  • file - select the proper file
  • name - type the proper name
  • description - type the description
status: 200 OK should be returned.Image Added 
1819

Print POD as PDF report.


URL:

http://localhost:8080/api/proofOfDeliveries/b49e860a-9559-4422-9adf-50ab106e7014/print?access_token=fb4ebbfc-2ef2-40e7-8ee9-ccdfa508487f

Method: GET

 


 

File should be saved in proper location. After opening, the PDF report with filled fields should be seen.

Image Added

 

 

 

Post – conditions: