Exemple #1
0
        public async Task <LoanApplicationResponseDTO> UpdateSummary(LoanApplicationSummaryRequest request, long loanApplicationId)
        {
            var loanApplication = await repository.FindAsync(loanApplicationId);

            LoanSummaryTextFields key = Enum.Parse <LoanSummaryTextFields>(request.Key);

            switch (key)
            {
            case LoanSummaryTextFields.BackgroundOfThePrincipalBorrower:
                loanApplication.BackgroundOfThePrincipalBorrower = request.Value;
                break;


            case LoanSummaryTextFields.NatureOfTheBusinesses:
                loanApplication.NatureOfTheBusinesses = request.Value;
                break;

            case LoanSummaryTextFields.RecommendationAndConditions:
                loanApplication.RecommendationAndConditions = request.Value;
                break;
            }

            entity.Update(loanApplication);

            await dbContext.SaveChangesAsync();

            return(mapper.Map <LoanApplicationResponseDTO>(loanApplication));
        }
Exemple #2
0
        public async Task <IActionResult> UpdateSummary([FromBody] LoanApplicationSummaryRequest request, long loanApplicationId, string session = "")
        {
            var loanApplication = await loanApplicationService.UpdateSummary(request, loanApplicationId);

            return(Ok(loanApplication));
        }