public IActionResult TopUpBalance(CardOperationDTO cardOperationDTO) { if (!ModelState.IsValid) { _logger.LogWarning(HttpStatusCode.BadRequest.ToString()); return(BadRequest(HttpStatusCode.BadRequest)); } var result = _cardOperation.TopUpBalance(cardOperationDTO.Amount, cardOperationDTO.CardId); if (!result) { _logger.LogWarning(HttpStatusCode.BadRequest.ToString()); return(BadRequest(HttpStatusCode.BadRequest)); } return(Ok()); }
public IActionResult TransferToCard(CardOperationDTO cardOperationDTO) { if (!ModelState.IsValid) { _logger.LogWarning(HttpStatusCode.BadRequest.ToString()); return(BadRequest(HttpStatusCode.BadRequest)); } var result = _cardOperation.TransferToCard(cardOperationDTO.Amount, cardOperationDTO.CardId, cardOperationDTO.NumberCardForTransfer); if (!result) { _logger.LogWarning(HttpStatusCode.BadRequest.ToString()); return(BadRequest(HttpStatusCode.BadRequest)); } return(Ok()); }