Compute the commission of freelancers based on generic parameters
To use this Application:
- Ensure that you have a server MySQL running (If not installed, you can dowload it from the Official Web site
Note: You can use another SQL server, but you must update the pom.xml
and the application.properties
files of the application
- Clone the repository:
git clone https://github.com/traynaud/commission_calculator.git
- Copy the
src/main/resources/application.properties.conf
as a local Version ofapplication.properties
- Fill the empty fields with your database credentials
- Create an account on https://ipstack.com and get your personal token
- Report your token in
application.properties
- Export the application as Runnable packaged Jar. It includes its own apache Server
- Launch the jar:
java -jar application.jar
Once you Application is started, the list of available APIs are given by the link: http://localhost:8080/swagger-ui.html
- Compute the freelancer commission based on available parameters:
POST /commission/compute
- Add a new configuration rule to compute freelancers commission:
POST /rules/add
- List all existing rules that are used to compute freelancer commissions:
GET /rules/list
To test the APIs, you can operate from the swagger-ui page, or from any client of your choice. The application comes with a Insomnia configuration file.
To use Insomnia, process as follow:
- Download Insomnia from the Insomnia official Website
- Import a configuration file from
src/main/resources/insomnia
(The lattest the better) - Change the value of the URL if you are using another configuration than
localhost:8080