Skip to content

Simple micro web service to mimic a "Bank Account". Through this web service, one can query about the balance, deposit money, and withdraw money. [Spring Boot Application]

Notifications You must be signed in to change notification settings

hendisantika/springboot-bank-account

Repository files navigation

springboot-bank-account

Bank Account REST API

What is this project for?

The goal of this mini project is to write a simple micro web service to mimic a “Bank Account”. Through this web service, one can query about the balance, deposit money, and withdraw money. Just like any Bank, there are restrictions on how many transactions/amounts it can handle. The details are described below.

  • Write a simple “Bank Account” web service using REST API design principles.
  • Program should have 3 REST API endpoints: Balance, Deposit, and Withdrawal
  • No requirement for authentication assume the web service is for one account only and is open to the world
  • No requirement for the backend store you can store it in a file or database (your decision)
  • Balance endpoint this will return the outstanding balance
  • Deposit endpoint credits the account with the specified amount
    • Max deposit for the day = $150K
    • Max deposit per transaction = $40K
    • Max deposit frequency = 4 transactions/day
  • Withdrawal endpoint deducts the account with the specified amount
    • Max withdrawal for the day = $50K
    • Max withdrawal per transaction = $20K
    • Max withdrawal frequency = 3 transactions/day
    • Cannot withdraw when balance is less than withdrawal amount
  • The service should handle all the error cases and return the appropriate error HTTP status code and error message (Eg. If an attempt is to withdraw greater than $20k in a single transaction, the error message should say “Exceeded Maximum Withdrawal Per Transaction”).

How do I run the project?

  • Execute ** start.sh **
  • N.B.: Internet Connection needed to donwload jars from Maven Repo

Rest Endpoints

Executing API calls using Curl

N.B.: Added backslash to escape on Windows OS

Running tests

  • Execute ** run-tests.sh **
  • Test Reports ** build/reports **
  • Test Results ** build/test-results **
  • [Code Coverage] Jacoco ** build/reports/jacoco/test/html/index.html **

About

Simple micro web service to mimic a "Bank Account". Through this web service, one can query about the balance, deposit money, and withdraw money. [Spring Boot Application]

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages