GithubHelp home page GithubHelp logo

loanservice's Introduction

Loan Service

This project is a Java-based loan service application.

Steps to Run the Project

Follow these steps to run the project:

  1. Prerequisites

    1. Install Java 11
       java -version   
       openjdk version "11.0.20.1" 2023-08-24
       OpenJDK Runtime Environment (build 11.0.20.1+1-post-Ubuntu-0ubuntu122.04)
       OpenJDK 64-Bit Server VM (build 11.0.20.1+1-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)
    1. Install Maven
        mvn -version
        Apache Maven 3.6.3
        Maven home: /usr/share/maven
        Java version: 11.0.20.1, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
        Default locale: en_IN, platform encoding: UTF-8
        OS name: "linux", version: "6.2.0-34-generic", arch: "amd64", family: "unix"
  2. Steps to run loan service application:

    git clone https://github.com/tarunjainsagar/LoanService.git
    cd LoanService
    mvn clean package
    java -jar target/loan-0.0.1-SNAPSHOT.jar
  3. Sample Api Calls:

    1. Fee Projections Api Request
    curl -X POST -H "Content-Type: application/json" -d '{
     "amount": 3000,
     "duration": 3,
     "startDate": "2023-11-01",
     "durationType": "WEEKLY",
     "installmentFrequency": "WEEKLY", "showDetails": true
     }' http://localhost:8080/loan/feeProjections
    1. Installment Projections Api Request
    curl -X POST -H "Content-Type: application/json" -d '{
     "amount": 3000,
     "duration": 3,
     "startDate": "2023-11-01",
     "durationType": "WEEKLY",
     "installmentFrequency": "WEEKLY", "showDetails": true
     }' http://localhost:8080/loan/feeProjections
    1. View Query/Request History Request
      curl -X GET "http://localhost:8080/loan/getQueryHistory?fromDate=2023-10-18&toDate=2023-10-18"
  4. Sample Responses:

    1. Fee Projections Api Response
    {
       "status": "200",
       "message": "Success",
       "data": {
          "actual_loan_amount": 3000,
          "no_of_installments": 3,
          "durationType": "WEEKLY",
          "installmentFrequency": "WEEKLY",
          "Projections": [
             {
                "date": "2023-11-01",
                "amount": 30.0,
                "remark": "Interest: 30.0, Service Fees: 0.0"
             },
             {
                "date": "2023-11-08",
                "amount": 45.0,
                "remark": "Interest: 30.0, Service Fees: 15.0"
             },
             {
                "date": "2023-11-15",
                "amount": 30.0,
                "remark": "Interest: 30.0, Service Fees: 0.0"
             }
          ],
          "projections_type": "/feeProjections"
       }
    }
    1. Installment Projections Api Response
    {
       "status": "200",
       "message": "Success",
       "data": {
          "actual_loan_amount": 3000,
          "no_of_installments": 3,
          "durationType": "WEEKLY",
          "installmentFrequency": "WEEKLY",
          "Projections": [
             {
                "date": "2023-11-01",
                "amount": 1030.0,
                "remark": "Interest: 30.0, Service Fees: 0.0, Principal Installment: 1000"
             },
             {
                "date": "2023-11-08",
                "amount": 1045.0,
                "remark": "Interest: 30.0, Service Fees: 15.0, Principal Installment: 1000"
             },
             {
                "date": "2023-11-15",
                "amount": 1030.0,
                "remark": "Interest: 30.0, Service Fees: 0.0, Principal Installment: 1000"
             }
          ],
          "projections_type": "/installmentProjections"
       }
    }
  5. API Documentation

    Available Endpoints:

    1. http://localhost:8080/loan/feeProjections
    2. http://localhost:8080/loan/installmentProjections

    HTTP Method: POST

    Content-Type: application/json

    Request Body

    The request body should be in JSON format and include the following parameters:

    amount (integer, required): The loan amount.

    duration (integer, required): The loan duration in terms of the selected durationType.

    startDate (string, required): The start date of the loan in 'yyyy-MM-dd' format.

    durationType (string, required): The type of duration (e.g., "WEEKLY" or "MONTHLY").

    installmentFrequency (string, required): The frequency of installments (e.g., "WEEKLY" or "MONTHLY").

    showDetails (boolean, optional): Set to true if you want to include details in the response.

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.