/transactions

Repository to Digital Hub - Backend Assignment - CP

Primary LanguagePython

Transactions

Digital Hub - Backend Assignment - CP

Installation

made with love & python 3.6

Use the package manager pip to install the libraries

  • First, install all dependencies:
pip3 install -r requirements.txt
  • Create the database "assignment_django" in your localhost (or your database server)

  • Change database settings in assignment_django/settings.py (line 78)

DATABASES = { 'default': { ...

  • Run the django migrations
python3.6 manage.py migrate
  • Create a superuser! (follow the wizard)
python3.6 manage.py createsuperuser
  • Run the account fixtures! (many as you want, ten per hit)
python3.6 manage.py fixtures
  • Run the django development server
python3.6 manage.py runserver
  • Open your browser in localhost:8000/

Usage

add transaction

POST /transactions/

get all transactions by account

GET /transactions/{account_number}

get all sent transactions by account

GET /transactions/{account_number}/?sent

get all received transactions by account

GET /transactions/{account_number}/?received

get account balance

GET /balance/{account_number}/

Important, use a basic auth with the user/pwd has been created as superuser

License

MIT