Giter VIP home page Giter VIP logo

test-transactions's Introduction

TEST - Transactions

Overview

A simple transaction processing. A transaction is an action of transferring money from one account to another.

Firstly, the processing owns 1 000 000 000.

When creating a user, he can obtain some money, transferred from the processing account.

A transaction cannot proceed (logical OR):

  • sender = receiver;
  • any of sender or receiver does not exist;
  • the sender does not have enough money;
  • the amount of money being transferred is negative;
  • when the receiver obtains transaction he would have too much money (more than 9 223 372 036 854 775 807).

Transaction on different accounts are running in parallel. Each has its own queue: there are no conflicting DB locks between DB-transactions that have no common accounts.

TODO

  • Add tests
  • Add specific errors to swagger
  • Add authentication and authorization
  • Create indices to SQL tables

Run

To read swagger documentation and try requests, run docker-compose, run make run from tx-go container. Docs will be at http://localhost:8081/docs

Generate code from documentation

Run make gen from tx-gen container.

Do not create files restapi/configure_tx.go, restapi/server.go by your own: they are deleted by make gen.

Migrations

Should be run from tx-go container.

Up:

make migrate.up

Down:

make migrate.down

Status:

make migrate.status

Create new migration with name new123:

make migrate.new migration_name=new123

test-transactions's People

Contributors

kaz-as 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.