openMF / online-banking

https://openmf.github.io/online-banking/
17 stars 26 forks source link

Feature - apply for loans #14

Closed ksraj123 closed 3 years ago

ksraj123 commented 3 years ago

Fixes #12 Don't see a development branch so opening the PR against master branch.

Here is a demo of the feature 29sec

Link to wireframe

Available Loan products for the login user is fetch from the GET /self/loans/template?templateType=individual&clientId=${userId} endpoint in resolver.

Different loan products have different ranges for principal (minPrincipal, maxPrincipal) the duration of the loan and repayment scheme (repaymentEvery, maxNumberOfRepayments, repaymentFrequencyType) and interest rate (minInterestRatePerPeriod, maxInterestRatePerPeriod) so upon selection of a loan product complete details for it are fetched by hitting the /self/loans/template?templateType=individual&clientId=${userId}&productId=${productId} endpoint.

Unless the complete details of the selected loan product are loaded all other input fields are disabled. Since in the wireframe we input fields for only loan product type, purpose and principal are indicated, all other fields are programatically decided to provide loan for maximum duration at the minimum possible interest rate.

Some loan products do not have all necessary fields for the required for applying for a new loan. If the user selects such a loan product then he is prompted though a toast. User also gets prompts through toasts on success or failure or loan application.

API endpoint for creating a new loan application - POST /self/loans

Please share feedback and suggestions. Thanks

ksraj123 commented 3 years ago

Travis build fails without latest changes to package-lock.json committed. Adding npm install to travis scripts should also fix this but it might increase build time.

Screenshot 2020-12-01 at 2 55 27 AM
manigedit commented 3 years ago

@ksraj123 I will take a look and review it.