-
Have PostgreSQL installed and create a database:
CREATE DATABASE order_db;
-
In application.properties file, fill the values for the properties below, according to your setup:
spring.datasource.username=postgres
spring.datasource.password=yourpassword
spring.mail.username=preferably@gmail.com
spring.mail.password=yourpwd
-
Other
spring.mail
setup may need adjustments if using other mail clients. -
spring.jpa.hibernate.ddl-auto
is configured as UPDATE, so data will be preserved between executions. -
Run OrderApplication (from IDE or using Maven):
mvnw spring-boot:run
A Postman collection inside the project is provided with some call examples:
sibs-test-api.postman_collection.json
Default CRUD functionality provided by Spring Data Rest.
All CRUD common methods.
POST/PUT methods will add an Order to the system, automatically completed if there is stock of that item (quantity
will be returned updated).
All CRUD common functionalities.
POST/PUT methods will add an Stock to the system, automatically completing an Order if the stock is enough (quantity
of the stock will be returned decreased when an Order is found).
One directory above the project, will be generated a sibs-test-logs
directory with the log file.