Giter Club home page Giter Club logo

balance's Introduction

balance

Microservice for working with user balances

Running the application

docker-compose up --build

Running the application without Docker

go run .

Running tests (app must be running)

go test .

HTTP Methods

"GET" /ping — Checking the server connection

    example: 
        "GET" :8080/ping

"GET" /balance — Gets the user's balance

    example: 
        "GET" :8080/balance
{
    "id" : "ec6761fa-4b02-4e93-a213-8fa96eb44d15"
}

"POST" /user — Create a new user

    example: 
        "POST" :8080/user
{
    "funds" : "55.55" // optional
}

"PATCH" /deposit — Depositing funds to the user's balance

    example: 
        "PACTCH" :8080/deposit
{
    "id" : "ec6761fa-4b02-4e93-a213-8fa96eb44d15",
    "funds" : "1000"
}

"PATCH" /reserve — Reservation of funds on the user's balance

    example: 
        "PATCH" :8080/reserve
{
    "userID" : "ec6761fa-4b02-4e93-a213-8fa96eb44d15",
    "serviceID" : "ec6741fa-4b02-4e03-a303-0fa96eb15d15",
	"orderID" : "ec6705fa-4b00-0e11-a013-8fa88eb74d35",
	"cost" : 3.5
}

"PATCH" /receipt — Charge off the user's balance

    example: 
        "PATCH" :8080/receipt
{
	"userID" : "ec6761fa-4b02-4e93-a213-8fa96eb44d15",
	"serviceID" : "ec6741fa-4b02-4e03-a303-0fa96eb15d15"
}

"DELETE" /user — Delete user

    example: 
        "DELETE" :8080/
{
	"id" : "ec6761fa-4b02-4e93-a213-8fa96eb44d15"
}

balance's People

Contributors

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