Code Monkey home page Code Monkey logo

bankingredefined's Introduction

Description

A banking software implementing REST api.

Technology

  • Java 11
  • Spring Boot
  • Gradle
  • Postgres

Database

Diagram

API

https://documenter.getpostman.com/view/14063258/TzCP8Tgb

Health

Get request to /health
You will receive OK if server is alive

Create Account

Creates a bank account for the customer and returns an object together with balance object.

Input

Post request to /accounts with a json file contraining following fields

{
"customerId": 1,
"firstname": "Shahriar",
"lastname": "Tanvir",
"country": "Bangladesh",
"currencies": ["BDT", "USD"]
}

Output

{
    "accountId": 5,
    "customerId": 1,
    "balances": [
        {
            "balance": 0,
            "currency": "BDT"
        },
        {
            "balance": 0,
            "currency": "USD"
        }
    ]
}

Get account

Return the account object.

Input

Get request to /accounts/{account_id} with account id as path variable

Output

{
    "accountId": 2,
    "customerId": 1,
    "balances": [
        {
            "balance": 400.00,
            "currency": "BDT"
        },
        {
            "balance": 100.00,
            "currency": "USD"
        }
    ]
}

Create Transaction

Create a transaction on the account and return the transaction object.

Input

Post a json object to /transactions with following fields
*Remember direction is of 2 types: IN and OUT

{
    "accountId" :2,
    "amount" : 100,
    "currency": "BDT",
    "direction": "OUT"
}

Output

{
    "transactionId": 12,
    "accountId": 2,
    "amount": 100,
    "currency": "BDT",
    "direction": "OUT",
    "balance": 300.00
}

Get Transaction

Returns a list of all transactions of an account.

Input

Get request to /transaction/{account_id} with account id as path variable

Output

[
    {
        "transactionId": 8,
        "accountId": 2,
        "amount": 500.00,
        "currency": "BDT",
        "direction": "IN",
        "balance": null
    },
    {
        "transactionId": 9,
        "accountId": 2,
        "amount": 100.00,
        "currency": "USD",
        "direction": "IN",
        "balance": null
    }
]

bankingredefined's People

Contributors

shhrrtnvr avatar

Watchers

James Cloos 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.