Giter Club home page Giter Club logo

atm-service's Introduction

ATM Machine

Requirements to Run

You need to have the following installed:

  • Java 8
  • PostgreSQL
  • Maven
  • Docker

DB Setup

The Application Interacts with a Postgress Database so a DB will have to be set up locally

This can be Done using PG Admin and creating a database - atm

alt text

The application.properties file will define the connection to the DB - see Credentials being used below

alt text

Required Tables will be created on startup of the Application

Running the Application Locally

When the Repo has been cloned locally, run the following commands in the root directiory to start the Application

  • mvn clean install
  • mvn spring-boot:run

Running on Docker

alt text

When the Repo has been cloned locally, run the following commands in the root directiory to run the Application on Docker

  • docker build -f Dockerfile -t atm-service .
  • docker run -p 8081:8081 atm-service

Note: When running on Docker the ip address and port being used to conect to Postgress will differ per machie

Manual Tests - Postman

The Application can be Tested locally using the following Enpoints

GET api/v1/atm/balance

Request

alt text

GET api/v1/atm/accounts/{accountNumber}/{pin} - valid account number & pin

Request

alt text

GET api/v1/atm/accounts/{accountNumber}/{pin} - valid account number & invalid pin

Request

alt text

PUT api/v1/atm/accounts/{accountNumber} Example - pin & amount in Body of Request

Request Example

alt text

Response Examples

valid pin & valid amount - sucessfully withdrwan

alt text

valid pin & not enough in Users account - user is told and nothing is effected

alt text

valid pin & not enough funds in ATM - user is told and nothing is effected

alt text

invalid pin - user is told and nothing is effected

alt text

Coverage level - Service layer

alt text

Improvements

A requirment listed below needs logic to be implemented in the Application yet

  • TO-DO - Dispense the minimum number of notes per withdrawal & inform details of the notes that would be dispensed

atm-service's People

Contributors

tomhamm avatar

Watchers

 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.