Ejemplo n.º 1
0
 public IActionResult GetAvailableCardsForCreditLine(ProductQualityFilterRequest request)
 {
     if (ModelState.IsValid)
     {
         var authorizedCustomer = _cacheHelper.GetAuthorizedCustomer();
         var response           = new SingleResponse <List <Card> >()
         {
             ResultCode = ResultCodes.normal
         };
         response.Result = _xbService.GetAvailableCardsForCreditLine(request.Filter);
         if (authorizedCustomer.LimitedAccess != 0)
         {
             response.Result.RemoveAll(m => !_xbService.HasProductPermission(m.CardAccount.AccountNumber, (ulong)m.ProductId));
         }
         foreach (var card in response.Result)
         {
             if (card.CardNumber != null)
             {
                 card.ArCaBalance = _xbService.GetArcaBalance(card.CardNumber);
                 if (card.CardAccount.AccountNumber == "220000295380000" && Convert.ToBoolean(_config["TestVersion"]))
                 {
                     card.ArCaBalance = null;
                 }
             }
         }
         return(ResponseExtensions.ToHttpResponse(response));
     }
     else
     {
         return(ValidationError.GetValidationErrorResponse(ModelState));
     }
 }