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 User.

URL:

http://localhost:8080/api/users/?access_token=3637f66b-4374-4482-a79e-888da5970b97

Method: POST

 

Example Body:

{

"username": "userLucy01",

"firstName": "nameLucy",

"lastName": "lastNameLucy01",

"verified": "true",

"active": "true"

}

                                                                                                               
          status: 201 created,          

user id: "http://localhost:8080/api/users/b0bded5a-3540-45a6-bcce-275a0fff9a5b"

                                                 

2

Create Program.

URL:

http://localhost:8080/api/programs/?access_token=3637f66b-4374-4482-a79e-888da5970b97

Method: POST

 

Example Body:

{

"code": "programnew01",

"name": "namenew",

"periodsSkippable": "true"

}

 

 

3

Create geographicLevel.

URL:

http://localhost:8080/api/geographicLevels/?access_token=bc5fb077-e565-405e-853f-87534e6e4bd4

Method: POST

Example Body:

{

"code": "geolevelnew01",

"levelNumber": "10"

}

 
status: 201 created,

geographicLevel id:

"http://localhost:8080/api/geographicLevels/aecd7aa6-3323-4682-b5ef-adddec8e190b"

 

4

Create geographicZone.

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

Method: POST

 

Example Body:

{

"code": "testowyc01",

"level": "http://localhost:8080/api/geographicLevels/aecd7aa6-3323-4682-b5ef-adddec8e190b"


}

 
 status: 201 created,

geographicZone id:

"http://localhost:8080/api/geographicZones/e4726cf2-99ae-43fd-8511-43007c891f3c"

 

5

Create FacilityType.

URL:

http://localhost:8080/api/facilityTypes/?access_token=bc5fb077-e565-405e-853f-87534e6e4bd4

Method: POST

 

Example Body:

{

"code": "facilitytype01",

"name": "name011"

}

 
 

6

 

7

Create Order.

URL: http://localhost:8080/api/orders

Method: POST

 

Example Body:

{

"createdBy": "http://localhost:8080/api/users/b0bded5a-3540-45a6-bcce-275a0fff9a5b",

"program": "http://localhost:8080/api/programs/dc815cbd-765a-4081-b0df-66dfa43080e1",

"requestingFacility": "http://localhost:8080/api/facilities/9ce62c6d-2cfe-4bae-84ce-47581d0a878f",

"receivingFacility": "http://localhost:8080/api/facilities/9ce62c6d-2cfe-4bae-84ce-47581d0a878f",

"supplyingFacility": "http://localhost:8080/api/facilities/9ce62c6d-2cfe-4bae-84ce-47581d0a878f",

"orderCode": "ordertesty101",

"status": "ORDERED",

"quotedCost": "98.444"


}

 

8

Change the status of the order to SHIPPED (request will be executed successfully if the order was created properly).

Example body:

Method: PUT
Header: TXT/HTML
URL:  http://localhost:8080/api/orders/b8870cc6-3148-411b-ac4b-153da0f65fc5/finalize?access_token=bc5fb077-e565-405e-853f-87534e6e4bd4

 

status: 200 OK,

 

 
9

 

...