Skip to content

t1m4/bank_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bank API

Technical requirements

Objective

Your assignment is to build an internal API for a fake financial institution using Python and Django.

Brief

While modern banks have evolved to serve a plethora of functions, at their core, banks must provide certain basic features. Today, your task is to build the basic HTTP API for one of those banks! Imagine you are designing a backend API for bank employees. It could ultimately be consumed by multiple frontends (web, iOS, Android etc).

Tasks

  • Implement assignment using:

    • Language: Python
    • Framework: Django
  • There should be API routes that allow them to:

    • Create a new bank account for a customer, with an initial deposit amount. A single customer may have multiple bank accounts.
    • Transfer amounts between any two accounts, including those owned by different customers.
    • Retrieve balances for a given account.
    • Retrieve transfer history for a given account.
  • Write tests for your business logic

    Feel free to pre-populate your customers with the following:

    [
      {
        "id": 1,
        "name": "Arisha Barron"
      },
      {
        "id": 2,
        "name": "Branden Gibson"
      },
      {
        "id": 3,
        "name": "Rhonda Church"
      },
      {
        "id": 4,
        "name": "Georgina Hazel"
      }
    ]`

    You are expected to design any other required models and routes for your API.

    Evaluation Criteria

    • Python best practices
    • Completeness: did you complete the features?
    • Correctness: does the functionality act in sensible, thought-out ways?
    • Maintainability: is it written in a clean, maintainable way?
    • Testing: is the system adequately tested?
    • Documentation: is the API well-documented?

    CodeSubmit

    Please organize, design, test and document your code as if it were going into production - then push your changes to the master branch. After you have pushed your code, you may submit the assignment on the assignment page.

Tools

  • Django and DRF
  • coverage
  • drf-yasg

Design notes

The application consists of three layers of abstraction:

  • View layer. Responsible for creating API view function and validation input user data.
  • Service layer. It's a place for all business logic and additional validation.
  • Database layer. Responsible for creating actual SQL queries and executing them.

Testing notes

Testing application using factory-boy for django models

Documendation notes

Add documendation using drf-yasg

About

Interview project on building bank API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages