Develop a Django REST Project for Lending Platform**

Thank you for your interest in one of our positions. In this exam, you will be tasked with creating a Django REST project for Lenme, a peer-to-peer lending platform. The project should facilitate the loan application and approval process, including the management of loan funding and repayment. Below are the project requirements:

Use Case:

One of Lenme’s borrowers has submitted a loan request for $5,000 to be repaid over 6 months. They have received an offer from one of the lenders on the platform with a 15% Annual Interest Rate. Additionally, a $3.75 Lenme fee will be added to the total loan amount to be paid by the lender.

Project Requirements:

You are required to develop a Django REST project to create the following flow through its APIs:

Database Selection:

You can choose one of the following databases:

  1. PostgreSQL (preferred)
  2. SQLite

Functionality:

1. The borrower should be able to submit a loan request for a $5,000 loan with a 6-month loan period.

2. Lenders should be able to retrieve a list of loans that do not have a lender and submit an offer to the borrower with a 15% Annual Interest Rate.

3. The borrower should have the ability to accept the lender’s offer.

4. Ensure that the investor has a sufficient balance in their account to fund the Total Loan Amount, which includes the Loan Amount and the Lenme Fee.

5. Once the investor successfully funds the loan, the loan status should be updated to “Funded.”

6. Schedule six monthly payments starting from the day the loan was funded. Note that developing an external scheduler is not required for this task.

7. Implement an API that allows the borrower to make monthly payments.

8. After all payments have been successfully made to the investor, update the loan status to “Completed.”

Unit Testing:

Write unit tests for the following endpoints to ensure functionality:

  • A test for the borrower’s loan request, lender offer, and loan funding process.

Documentation:

Create a README that includes the following:

  • Configuration details.
  • Description of endpoints and models, possibly in the form of a flow chart (you can use Swagger).

Additional Tasks (Optional):

For extra credit, you can consider the following tasks:

  1. Implement a mechanism to cache loans that don’t have users and expire the cache when there’s a new loan or a change in the loan status.
  2. Create a task that runs every hour using Celery and Celery Beat to manage loan repayments.