Skip to content

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.

Notifications You must be signed in to change notification settings

Nasrallah-Adel/LenmoTest

Repository files navigation

Lenmo-Test

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

To run Project

First

install Docker on your machine you can follow the steps here.

Second

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"

after run project

  • open your browser and type lenmo.localhost
  • the project will open on swagger documentation of APIS

Note 1

You won't see anything of API'S Until Authenticate who you are

Note 2

CELERY task run in background and print messages like send email to user just simulate the situation

10 type of user exist [BORROWER , INVESTOR ]

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

use case

first you need make two account one as borrower and second as investor

first

  • make BORROWER account from register

first first

  • after register save token of user to use it or you can get it by email and password from api-token link first first

  • make INVESTOR account from register first first

  • after register save token of user to use it or you can get it by email and password from api-token link first first

  • use authorize button to authorize your self and use api's

  • we use JWT authentication first

  • use your token like this JWT eyJ0eXAiOiJKV1QiLCJhbGciOi

  • and click on authorize button first

  • you will find API's appear for BORROWER first first

-use rhe same steps for INVESTOR get INVESTOR token and authorize by it and you will find INVESTOR APIS

first

first

first

first

first

finally open API'S links and test it

  • like this

first first

Apply Use Case

  • first the BORROWER make the loan request

first first

  • the investor can only get all loan requests just loan amount and period and the user request the loan

first first

  • investor can creat offer to loan request by take loan request id from the loans url api and enter the interest rate

first first

  • borrower can expand all loan requests if any investor create offer to his loan he can saw it

first first

  • if borrower need to accept offer take the offer id from my_loans url and accept offer

first first

  • after accept the status of loan changed and create the loan payments and change the offer status first first first first first

  • if borrower or investor need to deposit money first first

NOTE

- table in database (lenmonprofit) save 3$ from any offer accepted and save loan and related offer to it

Celery Jobs

  1. remind borrower with loan payment before two days of loan payment due date and ask user to check balance to pay loan payment
  2. if today the loan payment due date or any other old loan payment ( take balance from borrower and add to balance of investor)
  3. finally check if all payment of loan paid mark loan as completed

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published