Giter Site home page Giter Site logo

ilyaskarim / coinflowsystem Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 1.0 79 KB

A flexible and secure API-driven coin management system for integrating virtual currency functionality in games and applications.

License: Apache License 2.0

TypeScript 98.95% Shell 1.05%

coinflowsystem's People

Contributors

ilyaskarim avatar

Stargazers

 avatar  avatar

Watchers

 avatar

coinflowsystem's Issues

Create Transaction apis

We need to following crud apis for transactions:

  • create
  • update
  • delete

We need to to follow our current setup, creating validations like src/v1/user.validation.ts and methods in src/v1/user.ts. We need to create apis in:

  • src/v1/wallet.validation.ts
  • src/v1/wallet.ts

and finally need to setup routes in src/v1/routes.ts.

Verification: Checks

  • On create, delete and update, we need to update the wallet balance.

Create Wallet APIs

We need to following crud apis for wallets:

  • create
  • update
  • delete

We need to to follow our current setup, creating validations like src/v1/user.validation.ts and methods in src/v1/user.ts. We need to create apis in:

  • src/v1/wallet.validation.ts
  • src/v1/wallet.ts

and finally need to setup routes in src/v1/routes.ts.

Create a new api endpoint for getting user balance

Task 1: Create a new api endpoint for getting user balance

The api endpoint should be GET /api/v1/users/getUserBalance, the initial code is already in place, you just need to implement the logic to get the user balance from the database and return it as a response. The response should be in the format below:

{
  "message": "User balance retrieved successfully",
  "balance": "1000"
}

Task 2: Create a new api endpoint for getting user transactions

The api endpoint should be GET /api/v1/users/getTransactionsByUser, the initial code is already in place, you just need to implement the logic to get the user transactions from the database and return it as a response. The response should be in the format below:

{
  "message": "User transactions retrieved successfully",
  "transactions": [
    {
      "id": "1",
      "amount": "1000",
      "type": "credit",
      "createdAt": "2021-07-01T00:00:00.000Z"
    },
    {
      "id": "2",
      "amount": "500",
      "type": "debit",
      "createdAt": "2021-07-01T00:00:00.000Z"
    }
  ]
}

If we send a query parameter showBalance, it will return balance as well, so the response will be in the format below:

{
  "message": "User transactions retrieved successfully",
  "balance": 500,
  "transactions": [] // array of transactions
}

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.