Wallet Application

A wallet system built with django and contanerized with docker. This system would only be accessible to authenticated users.

Wallet Application

Technologies

Description

A wallet system for a product used in multiple countries.

User types

Noob

  • Can only have a wallet in a single currency selected at signup (main).
  • All wallet funding in a different currency should be converted to the main currency.
  • All wallet withdrawals in a different currency should be converted to the main currency before transactions are approved.
  • All wallet funding has to be approved by an administrator.
  • Cannot change main currency.

Elite

  • Can have multiple wallets in different currencies with a main currency selected at signup.
  • Funding in a particular currency should update the wallet with that currency or create it.
  • Withdrawals in a currency with funds in the wallet of that currency should reduce the wallet balance for that currency.
  • Withdrawals in a currency without a wallet balance should be converted to the main currency and withdrawn.
  • Cannot change main currency

Admin

  • Cannot have a wallet.
  • Cannot withdraw funds from any wallet.
  • Can fund wallets for Noob or Elite users in any currency.
  • Can change the main currency of any user.
  • Approves wallet funding for Noob users.
  • Can promote or demote Noobs or Elite users

How to Use and Test this Application

  • Clone the Repository
  • Create a .env file & fill in the values accordingly
  • Run docker-compose up --build
  • run migrations docker-compose exec web python manage.py makemigrations
  • run docker-compose exec web python manage.py migrate
  • run tests docker-compose exec web python manage.py test

As a User

  • Using the API endpoints Make requests to register a user, add wallet, fund wallet and make withdrawals.

As an Admin using the hosted API

  • Hit the login endpoint using the following admin credentials
email= seyi@test.com
password= striker
  • Or hit the register admin endpoint to register an admin.
  • Login with admin email and password
  • Hit the promote user endpoint to promote a Noob to Elite.
  • Hit the demote user endpoint to demote an Elite.
  • Hit the approve transactions endpoint to approve withdrawal transactions for Noob users.

Link to Heroku

Link to API Documentation

https://documenter.getpostman.com/view/2920412/UVRGF4UE

Comments