Exemplo n.º 1
0
        public IActionResult ApproveLoanProductOrder(ApproveLoanProductOrderRequest request)
        {
            if (ModelState.IsValid)
            {
                var response = new SingleResponse <long>()
                {
                    ResultCode = ResultCodes.normal
                };
                LoanProductOrder   order = new LoanProductOrder();
                AuthorizedCustomer authorizedCustomer = _cacheHelper.GetAuthorizedCustomer();

                if (request.ProductType == 1)
                {
                    order = _xbService.GetLoanOrder(request.Id);
                }
                if (request.ProductType == 2)
                {
                    order = _xbService.GetCreditLineOrder(request.Id);
                }
                if (request.ProductType == 3)
                {
                    order = _xbService.GetCreditLineOrder(request.Id);
                }

                ActionResult saveResult = _xbService.ApproveLoanProductOrder(order);

                response.ResultCode  = ResultCodeFormatter.FromPersonalAccountSecurityService(saveResult.ResultCode);
                response.Result      = saveResult.Id;
                response.Description = utils.GetActionResultErrors(saveResult.Errors);

                return(ResponseExtensions.ToHttpResponse(response));
            }
            else
            {
                return(ValidationError.GetValidationErrorResponse(ModelState));
            }
        }