예제 #1
0
        public IActionResult ApprovePlasticCardOrder(ApproveIdRequest request)
        {
            if (ModelState.IsValid)
            {
                var response = new SingleResponse <long>()
                {
                    ResultCode = ResultCodes.normal
                };

                PlasticCardOrder order = _cacheHelper.GetApprovalOrder <PlasticCardOrder>(request.Id);
                if (order.Attachments != null)
                {
                    foreach (var item in order.Attachments)
                    {
                        item.AttachmentInBase64 = _xbService.GetOrderAttachmentInBase64(item.Id);
                    }
                }
                ActionResult saveResult = _xbService.ApprovePlasticCardOrder(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));
            }
        }