Before running the project make sure the MySQL database is running.
To start the DB go to folder order-backend/db-start
and then execute the docker compose up
command.
Also you need to run our local AWS/SQS. To do this use the flowing commands in order on the order-backend
folder:
docker-compose up -d
docker exec -it localstack sh
ws --endpoint-url=http://localhost:4566 sqs create-queue --queue-name order-queue.fifo --attributes FifoQueue=true
To run the project execute the mvn spring-boot:run
command.
To run the tests execute the mvn test
command.
You can also access the swagger ui interface in http://localhost:8080/swagger-ui/
List all orders
Name | Type | Description | Default |
---|---|---|---|
page | integer | 1-based index of the results page | 1 |
size | integer | Number of search results per page | 10 |
Status | Meaning | Description |
---|---|---|
200 | OK | successful operation |
404 | Not Found | location not found |
Creates a new order
Name | Type | Description |
---|---|---|
productType | string | product type of the order |
description | string | description of the order |
customer | Integer | customer that created the order |
Status | Meaning | Description |
---|---|---|
200 | OK | successful operation |
400 | Bad Request | wrong input parameters |
Process payment for the order
Name | Type | Description |
---|---|---|
orderId | long | id for the order that will be paid |
Status | Meaning | Description |
---|---|---|
200 | OK | successful operation |
400 | Bad Request | wrong input parameters |
- Cancel order*
Name | Type | Description |
---|---|---|
orderId | long | id for the order that will be canceled |
Status | Meaning | Description |
---|---|---|
200 | OK | successful operation |
400 | Bad Request | wrong input parameters |
Send order to print queue
Name | Type | Description |
---|---|---|
orderId | long | id for the order that will be sent to queue |
Status | Meaning | Description |
---|---|---|
200 | OK | successful operation |
400 | Bad Request | wrong input parameters |
List all customers
Status | Meaning | Description |
---|---|---|
200 | OK | successful operation |
404 | Not Found | location not found |
Creates a new customer
Name | Type | Description |
---|---|---|
firstName | string | first name of the new customer |
lastName | string | last name of the new customer |
string | e-mail of the new customer | |
country | string | country of the new customer |
zipCode | string | zip code of the new customer |
city | string | city of the new customer |
addressLine | string | address line name of the new customer |
Status | Meaning | Description |
---|---|---|
200 | OK | successful operation |
400 | Bad Request | wrong input parameters |