Git Product home page Git Product logo

loevegas's Introduction

LeoVegas Springboot app

Create API for wallet that provides below service

  • Debit Transaction
  • Credit Transaction
  • Transaction History
  • Account balance

Requirements

Getting Started

There are several ways to run a Spring Boot application on your local machine. One way is to execute the main method in the VegasApplication.class class from your IDE.

Alternatively you can use the Spring Boot Gradle plugin like so:

gradle bootRun

REST API

application have default user that is [email protected] and user id id mandatory.

Posting request using curl

Request

GET /account/{userId}

Response

{"userId":"[email protected]","amount":500.00,"lastUpdate":"2020-05-19T14:10:12.835"}

Request

GET /transaction/{userId}

Response

[{"transactionId":"188232sa70","transactionAmount":100.00,"transactionStatus":"COMPLETED","transactionType":"CREDIT"},{"transactionId":"18823wsa70","transactionAmount":100.00,"transactionStatus":"COMPLETED","transactionType":"CREDIT"},{"transactionId":"1823wsa70","transactionAmount":100.00,"transactionStatus":"COMPLETED","transactionType":"CREDIT"},{"transactionId":"1823ws11a70","transactionAmount":100.00,"transactionStatus":"COMPLETED","transactionType":"CREDIT"},{"transactionId":"1823wsa7099","transactionAmount":100.00,"transactionStatus":"COMPLETED","transactionType":"CREDIT"}]

Request

POST /debit/

curl -X POST  http://localhost:8080/credit -H 'cache-control: no-cache' -H 'content-type: application/json' -d '{ "amount": 100, "userId": "[email protected]", "transactionId": "1823wsa70" }'

Response

{"transactionId":"1823wsa7099","transactionAmount":100,"transactionStatus":"COMPLETED","transactionType":"DEBIT"}

Request

POST /credit/

curl -X POST  http://localhost:8080/credit -H 'cache-control: no-cache' -H 'content-type: application/json' -d '{ "amount": 100, "userId": "[email protected]", "transactionId": "1823wsa70" }'

Response

{"transactionId":"158298sa70","transactionAmount":100,"transactionStatus":"COMPLETED","transactionType":"CREDIT"}

loevegas's People

Watchers

 avatar  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.