Skip to content

Mikbac/Salary-Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Language grade: Java Total alerts

GitHub

Salary Calculator

The application converts salary to PLN.

Table of contents

Getting Started

Adding the new country

  • You can use POST in swagger.
http://localhost:8080/swagger-ui.html#/
  • Or add countries to the import.sql file before running the application.

Added countries

  • United Kingdom - UK
  • Germany - DE
  • Poland - PL

Prerequisites

  • Maven
  • JDK 8

Installing

  1. (Optional) Set profile via application.properties (production or development). The default profile is development.

  2. Build and run the application:

mvn install
cd target   
java -jar salaryapp-1.0-SNAPSHOT.war

or

docker build --tag mikbac/salary_app:1.0 -f Dockerfile .
docker container run -p 8080:8080 --ip 0.0.0.0 --name salary_app mikbac/salary_app:1.0
  1. Open the browser and hit
http://localhost:8080/

Metric tools and consoles provided

All tools are available ONLY for active development profile.

Spring Boot Actuator

A list of all endpoints is available in the Spring documentation.

e.g.

http://localhost:8080/info

Swagger

URL:

http://localhost:8080/swagger-ui.html

H2 Console

Password and login user are available in application.properties file.

URL:

http://localhost:8080/h2-console/

API Endpoint

Endpoints Usage Params
GET /api/countries Get all of the countries available for the app.
POST /api/countries Add a new countryModel. countryCode - [String]
tax - [BigDecimal]
fixedCosts - [BigDecimal]
currencyCode - [String]
GET /api/salaries/pln?countryCode={countryCode}&salary={salaryFromClient} Calculate salary. {countryCode} - Country code
{salaryFromClient} - Salary

Example:

An example of an HTTP request is available in the http/question.http file.

Built with

The application uses the NBP Web API.

Example of features

ex1