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
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.
Fixes #12 Don't see a development branch so opening the PR against master branch.
Here is a demo of the feature
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