Skip to content

Simple RESTful API for transferring money between two accounts.

Notifications You must be signed in to change notification settings

nameishari/money-transfer-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Overview

Simple RESTful API for transfering money between two accounts.

Frameworks/Libraries used:

  • Spark Java
  • JOOQ
  • H2 as in-memory database
  • Junit and Rest Assured

Endpoints

  • POST /account - Creates an acccount
    • example request body
      {
      	"balance": 100.01
      }
  • GET /account/<accountId> - returns an account with balance
  • POST /account/<accountId>/transfer - transfers money from one account to another
    • example request body
      {
      		"destinationAccountId" : "5fd25de2-3051-4e50-ade1-f9bfe4e6506e",
            "sourceAccountId": "11fa45c3-2ff1-46db-8073-2c1431441161",
            "amount": 200
      }
  • GET /account/<accountId>/transfer - returns all account made by an account

Running

This service is using maven wrapper, it is not necessary to have maven in the execution environment.

./mvnw clean verify - to run tests

./mvnw clean package - creates executable jar

java -jar ./target/money-transfer-service-1.0-SNAPSHOT.jar - Running the executable jar on default port(8090)

java -Dserver.port=8080 -jar ./target/money-transfer-service-1.0-SNAPSHOT.jar - If default port, 8090 already in use then it can be changed with server.port

About

Simple RESTful API for transferring money between two accounts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages