Use case
A Lenmo borrower would like to borrower $5,000.00 on paying them back on 6 months period. One of Lenmo investors has offered him 15% Annual Interest Rate. A $3.00 Lenmo fee will be added to the total loan amount to be paid by the investor.
Requirements: You are required to develop a Django REST project to be able to build the following flow through its APIs;
1-The borrower creates a loan request including the above loan amount and loan period 2-The investor will submit an offer for the borrower’s loan request with the above interest rate 3-The borrower will accept the offer Check if the investor has sufficient balance in their account before they fund the loan 4-The loan will be funded successfully and the loan status will be Funded 5-The loan payments will be created with the monthly amount to be paid and its due date 6-Once all the payments are successfully paid to the investor, the loan status will be Completed
install Docker on your machine you can follow the steps here.
cd to folder of project
cd LenmoTest
docker-compose up --build
if open project for first time use "docker-compose up --build
" , if you use it before without change the
setting of docker file
or docker-compose you can just use "docker-compose up
"
- open your browser and type lenmo.localhost
- the project will open on swagger documentation of APIS
CELERY task run in background and print messages like send email to user just simulate the situation
when yo login as BORROWER you can use only API'S belong to BORROWER and when yo login as INVESTOR you can use only API'S belong to INVESTOR
- open your browser after run docker-compose and type lenmo.localhost
- make BORROWER account from register
-
after register save token of user to use it or you can get it by email and password from api-token link
-
after register save token of user to use it or you can get it by email and password from api-token link
-
use authorize button to authorize your self and use api's
-
use your token like this
JWT eyJ0eXAiOiJKV1QiLCJhbGciOi
-use rhe same steps for INVESTOR get INVESTOR token and authorize by it and you will find INVESTOR APIS
- like this
- first the BORROWER make the loan request
- the investor can only get all loan requests just loan amount and period and the user request the loan
- investor can creat offer to loan request by take loan request id from the loans url api and enter the interest rate
- borrower can expand all loan requests if any investor create offer to his loan he can saw it
- if borrower need to accept offer take the offer id from my_loans url and accept offer
- table in database (lenmonprofit) save 3$ from any offer accepted and save loan and related offer to it
- remind borrower with loan payment before two days of loan payment due date and ask user to check balance to pay loan payment
- if today the loan payment due date or any other old loan payment ( take balance from borrower and add to balance of investor)
- finally check if all payment of loan paid mark loan as completed