Skip to content

A REST API mimicing the actions of an ATM machine

Notifications You must be signed in to change notification settings

TomHamm/atm-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A REST API mimicing the actions of an ATM machine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published