Giter VIP home page Giter VIP logo

annuity-loan-calculator's Introduction

Annuity Loan Calculator

An annuity loan is a type of loan an annuity holder borrows money against the cash value of the annuity contract.

The project implements a repayment plan calculator for an annuity loan which comprises of the amount that the borrower has to pay back every month along with the principal and interest repayments, based on the formula:

Annuity Loan Formula

Compile

In order to compile the project, you'll require JDK 8 and Maven build tool to be installed and configured on your PC. The project can be compiled and the required artifacts can be generated by running the command:

mvn clean install

Run

The spring-boot application can be executed using the maven spring-boot plugin by running the following command:

mvn spring-boot:run -Dserver.port=8080

This will setup a tomcat web-server on your localhost to listen on the specified port, in this case 8080.

API Usage

POST /loans/annuity/plan

Example Request Body:

{
  "loanAmount": "5000",
  "nominalRate": "5.0",
  "duration": 24,
  "startDate": "2018-01-01T00:00:01Z"
}

Example Response:

{
  "repayments": [
    {
      "borrowerPaymentAmount": 219.36,
      "date": "2018-01-01T00:00:01",
      "initialOutstandingPrincipal": 5000,
      "interest": 20.83,
      "principal": 198.53,
      "remainingOutstandingPrincipal": 4801.47
    },
    {
      "borrowerPaymentAmount": 219.36,
      "date": "2018-02-01T00:00:01",
      "initialOutstandingPrincipal": 4801.47,
      "interest": 20.01,
      "principal": 199.35,
      "remainingOutstandingPrincipal": 4602.12
    },
   ...
    {
      "borrowerPaymentAmount": 219.28,
      "date": "2019-12-01T00:00:01",
      "initialOutstandingPrincipal": 218.37,
      "interest": 0.91,
      "principal": 218.37,
      "remainingOutstandingPrincipal": 0
    }
  ]
} 

Reference Documentation

For further reference, please consider the following sections:

Bibliography

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.