Credit Approval System Assignment
Credit Approval System Assignment
To add a new customer into the system, one must use the '/register' API endpoint. The request body should include the customer's first name, last name, age, monthly income, and phone number. Based on the monthly income, the system calculates the approved credit limit by multiplying the monthly salary by 36, rounding it to the nearest lakh, and stores this in the customer table. The response confirms the registration with details including the customer ID, name, age, monthly income, approved limit, and phone number .
The approved credit limit for a new customer is determined by multiplying the customer's monthly salary by 36 and rounding it to the nearest lakh .
A corrected interest rate might be suggested in the loan approval response to align with the customer's credit rating. When the proposed interest rate does not match the expected slab rate based on the customer's credit limit, the system provides a corrected interest rate. For instance, if the credit rating implies a minimum rate of 16% but the proposed rate is lower, the corrected rate would be set to the minimum slab rate of 16% .
The benefits of using Django Rest Framework (DRF) for building APIs in the credit approval system include its flexible and modular architecture that facilitates the rapid development of robust APIs. DRF offers powerful serialization that integrates seamlessly with Django's ORM, enabling efficient processing and transformation of data. Additionally, DRF provides built-in support for authentication, permission handling, and documentation generation, contributing to the security and user-friendliness of the system's API .
Dockerizing the entire application and its dependencies is important because it ensures consistency of the environment across different stages of development, testing, and production. It facilitates easier deployment, scalability, and management of the application by encapsulating all necessary components within a container, allowing them to run identically on any system that supports Docker .
The credit approval system ensures code integrity and organization through code quality practices such as segregation of responsibilities in the code base. This includes organized structuring of application logic and functionalities into distinct modules, aiding in maintenance and scalability. Although unit tests are not mandatory, they are encouraged for bonus points, further promoting code reliability .
A loan might not be approved even if a customer's credit rating is sufficient if the sum of all current EMIs exceeds 50% of the customer's monthly salary or if the interest rate does not match the slab determined by the credit limit .
The key components to consider when assigning a credit score to a customer in the credit approval system include past loans paid on time, the number of loans taken in the past, loan activity in the current year, loan approved volume, and if the sum of the customer's current loans exceeds their approved limit. If so, the credit score is set to 0 .
The compound interest scheme affects the calculation of monthly interest by applying interest on the principal amount, which includes previously accrued interest. This results in a slightly higher accumulation of interest over time compared to simple interest. For loan processing, it means calculating the monthly repayment amount that accounts for this compounding effect, thus influencing the overall cost of the loan for the customer .
Background workers play a crucial role in the initialization of the credit approval system by handling the ingestion of initial data from provided Excel files into the system. This ensures that customer and loan data are efficiently processed and stored in the database without blocking the main application workflow, allowing the system to handle other tasks simultaneously .