Versions Compared

Key

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

...

                                                             

Step

Action

Expected system response

Comment

 Note: Remember to generate token for authentication using some rest client. Copy the token from response (e.g. {"access_token":"121d02ed-b6b4-4233-9566-cac2b8a3aec9"...).

The token will expire after 1

hour. Then, it's necessary to generate the new one.

1


Create geographicZone

URL: http://localhost:8080/api/geographicZones/?access_token=b31b42b568be1238-6acf021f-4d3d4126-b8dea676-19597374c53b8fdb7dca0d6d

Method: POST

Example body:

{

"code": "zonecode",

"name": "zonename",

"level": "http://localhost:8080/api/geographicLevels/137ca6e037bf6690-2bf79fdd-49374b90-ac0abb51-71e4f76f81e51d9e83d1d0b2"

}


                                                                                                          
                                                                                                   
                 status: 201 created is returned,             

id: "http://localhost:8080/api/geographicZones/e39d79d7-6c65-47ac-9be5-c4090b40753c"

                                                                              Image Added
                                                 

2

Create geographicLevel

URL: http://localhost:8080/api/geographicLevels/?access_token=b31b42b568be1238-6acf021f-4d3d4126-b8dea676-19597374c53b8fdb7dca0d6d

Method: POST

Example body:

{

"code": "levelcode",

"name": "levelname",

"levelNumber": "2"

}

  status: 201 created is returned,  

id: "http://localhost:8080/api/geographicLevels/37bf6690-9fdd-4b90-bb51-1d9e83d1d0b2"

Image Added

 

3

Create facilityType

URL: http://localhost:8080/api/facilityTypes/?access_token=b31b42b568be1238-6acf021f-4d3d4126-b8dea676-19597374c53b8fdb7dca0d6d

Method: POST

Example body:

{

"code": "codefac",

"name": "namefac",

"description": "abc"

}

 

 

4

Create Schedule

URL: http://localhost:8080/api/schedules/?access_token=b31b42b568be1238-6acf021f-4d3d4126-b8dea676-19597374c53b8fdb7dca0d6d

Method: POST

Example body:

{

"code": "schedulecode",

"description": "desccode",

"name": "schedulename"

}

 

status: 201 created is returned,

id: "http://localhost:8080/api/schedules/136e5c30-8bf0-437c-b8b2-7485fbd966c4"

Image Added

 

5

Create Period

URL: http://localhost:8080/api/periods/?access_token=b31b42b568be1238-6acf021f-4d3d4126-b8dea676-19597374c53b8fdb7dca0d6d

Method: POST

Example body:

{

"processingSchedule": {

"id": "4aeabf8e136e5c30-ac1b8bf0-4b80437c-9d19b8b2-4f14f22e7bbc7485fbd966c4",

"code": "schedulecode",

"description": "desccode",

"name": "schedulename"

},

"name": "periodname",

"description": "descperiod",

"startDate": "2016-08-10",

"endDate": "2016-08-12"

}

 

 

6

Create program

URL: http://localhost:8080/api/programs/?access_token=b31b42b568be1238-6acf021f-4d3d4126-b8dea676-19597374c53b8fdb7dca0d6d

Method: POST

Example body:

{

"code": "programcode",

"name": "programname",

"periodsSkippable": "true"

}

 

status: 201 created is returned,

id: "http://localhost:8080/api/programs/25946e13-b09e-4417-a074-c61df0834886"

Image Added

 

7

Create facility

URL: http://localhost:8080/api/facilities/?access_token=b31b42b568be1238-6acf021f-4d3d4126-b8dea676-19597374c53b8fdb7dca0d6d

Method: POST

Example body:

{

"code": "facilitycode",

"name": "facilityname",

"descriptiondescirption": "abc",

"geographicZone": "http://localhost:8080/api/geographicZones/828ad26ce39d79d7-746f6c65-441f47ac-8a369be5-7e4be8041a2fc4090b40753c",

"type": "http://localhost:8080/api/facilityTypes/b4a5490e9ee2532c-e67a3cea-465c4fbc-ae558e80-68e769604252e18548a2365b",

"active": "true",

"enabled": "true"

}

Image Added

 

8

                      

SupervisoryNode.

URL: http://localhost:8080/api/supervisoryNodes/?access_token=b31b42b568be1238-6acf021f-4d3d4126-b8dea676-19597374c53b8fdb7dca0d6d

Method: POST

Example body:

{

"code": "nodecode",

"name": "nodename",

"facility": "http://localhost:8080/api/facilities/2b746ecc314e7992-cafac717-4da54ae1-b41f89fa-0fe42ce6dfa3821c15bc2c37"

 

}


                          
Image Added

 

9

Create supplyLine.

URL: http://localhost:8080/api/supplyLines/?access_token=b31b42b568be1238-6acf021f-4d3d4126-b8dea676-19597374c53b8fdb7dca0d6d

Method: POST

Example body:

{

"supervisoryNode": "http://localhost:8080/api/supervisoryNodes/ad38831e2e7cce9d-ef05dabd-4e6743ae-80b09283-66c935dcca9305be2471ad21",

"program":"http://localhost:8080/api/programs/919d0e6125946e13-348db09e-43854417-9e85a074-1db6f6baa8bdc61df0834886",

"supplyingFacility": "http://localhost:8080/api/facilities/2b746ecc314e7992-cafac717-4da54ae1-b41f89fa-0fe42ce6dfa3821c15bc2c37"

}

 

 
10

Create requisition.

URL: http://localhost:8080/api/requisitions/?access_token=b31b42b568be1238-6acf021f-4d3d4126-b8dea676-19597374c53b8fdb7dca0d6d

Method: POST

Example body:

{

"facility": "http://localhost:8080/api/facilities/2b746ecc314e7992-cafac717-4da54ae1-b41f89fa-0fe42ce6dfa3821c15bc2c37",

"program":"http://localhost:8080/api/programs/919d0e6125946e13-348db09e-43854417-9e85a074-1db6f6baa8bdc61df0834886",

"processingPeriod": "http://localhost:8080/api/periods/048c1d1445dbaf0f-59de6be7-4b73462f-8ed1b66e-1ebb85bb2976530317eb03ae",

"status": "APPROVED",

"emergency": "true",

"supervisoryNode": "http://localhost:8080/api/supervisoryNodes/ad38831e2e7cce9d-ef05dabd-4e6743ae-80b09283-66c935dcca9305be2471ad21"

}

Image Added 
11

Try to convert requisition to order.

URL: http://localhost:8080/api/orders/requisitions/?access_token=b31b42b568be1238-6acf021f-4d3d4126-b8dea676-19597374c53b8fdb7dca0d6d

Method: POST

Example body:

 [

   { "id": {  "35ae9e88381204d6-0f7ff801-4e524a10-95838d44-4756237404e5fc1734c33592"}

]

status: 201 created is returned.

Image Added

The status of requisition is changed to RELEASED.

Image Added

 
12

Verify if order is created.

URL: http://localhost:8080/api/orders?access_token=68be1238-021f-4126-a676-8fdb7dca0d6d

Method: GET

 

status: 200 OK is returned.

Image Added

 

 

 

Post – conditions: