Giter VIP home page Giter VIP logo

netcalculator's Introduction

Net Calculator

Net Calculator service (netcalculator) for any company which provides financial services across currencies, be it international or even worldwide. Developed with Java 17. It is a service which allows consumers to calculate the net price based on the input gross price and VAT (MWSt).

Calculation formula:

The simplest interface for the net price formula expects two parameters from end users or integrated services:

  • gross price
  • ISO country code

The formula is listed below:

'''netPrice = calculateNetPrice(grossPrice, countryIso);'''

Some Examples of the Usage of Net Price Formula:

'''81 = calculateNetPrice(100, DE); 1.6 = calculateNetPrice(1.99, FR);'''

This service accesses

taxRateProvider
service which returns the current VAT rate required to calculate the net price for a given country. The tax data used by the
taxRateProvider
is represented as a simple map of country code to tax rate.

Some Examples of CountryCode To TaxRate:

  • "DE":"0.19", // Germany has 19% VAT on standard taxable goods
  • "FR":"0.20", // France has 20% VAT on standard taxable goods

It is a fully runnable (with mvn) and testable Java implementation along with the instructions required for a reviewer.

Projects and Components

  • eureka: Eureka server for service discovery
  • api-gateway: to welcome incoming requests for services
  • net-calculator: to present the net price data to consumers
  • tax-rate-provider: to retrieve VAT rate for specified country

Instructions for a Reviewer to Execute the Services

Compile and Install Projects

  • Inside eureka project directory: Run mvn install.
  • Inside api-gateway project directory: Run mvn install.
  • Inside net-calculator project directory: Run mvn install.
  • Inside tax-rate-provider project directory: Run mvn install.

Start Services

The services should be started in the following order to ensure smooth functioning:

  • Start eureka project as a Java Application or Spring Boot App.
  • Start api-gateway project as a Java Application or Spring Boot App.
  • Start net-calculator project as a Java Application or Spring Boot App.
  • Start tax-rate-provider project as a Java Application or Spring Boot App.

Access the Services

Hit the following URLs with a modern web browser or a REST client:

The last two parts of URL paths signify the following semantics:

  • de / fr: country codes
  • 129 / 1.39: gross prices

In response, respective net prices are be returned. You may try other values of country code and gross price as well.

For any queries, feel free to utilise the contact points at:

netcalculator's People

Contributors

rishiraj88 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.