Giter Site home page Giter Site logo

revolut_test's Introduction

revolut_test

Backend Test

Design and implement a RESTful API (including data model and the backing implementation) for money transfers between accounts.

How to start application

Works with jdk 1.8

Command to start:

mvn clean package
java -jar target/test_task-1.0-SNAPSHOT.jar

How it's work

Rest API: http://localhost:8080/api/transfer

Send request with Content-Type: application/json

example of JSON:

{
  "paymentPurpose": "need",
  "accountNumberFrom": 321,
  "recipientAccount": 123,
  "transferAmount": 1000
}

Parameters to request

     * Purpose of payment
    String paymentPurpose;

     * Sender's account
    long accountNumberFrom;

     * Recipient account
    long recipientAccount;

     * Transfer amount
    BigDecimal transferAmount;

Response example

Example of success response

{
  "accountAmountFrom":2500,
  "accountAmountTo":2200,
  "accountNumberFrom":321,
  "paymentPurpose":"need",
  "recipientAccount":123,
  "transferAmount":1000,
}

Example of failed response

{
  "accountNumberFrom":321,
  "recipientAccount":123,
  "rejectionReason":"Error when transferring money amount insufficient to transfer.You try to transfer money sum: 1000 on you account amount: 500",
  "transferAmount":1000,
}

What account we have in DB to transfer money

  1. Account number: 123, Amount of account: 1200

  2. Account number: 321, Amount of account: 3500

  3. Account number: 213, Amount of account: 23000

revolut_test's People

Contributors

sizovns avatar

Watchers

James Cloos avatar

Forkers

evgin

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.