Your assignment is to build an internal API for a fake financial institution using Python and Django.
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).
-
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.
- 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?
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.
- Django and DRF
- coverage
- drf-yasg
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 application using factory-boy for django models
Add documendation using drf-yasg