Ejemplo n.º 1
0
        public async Task <IActionResult> ActivateBankAccount([FromRoute] int accountId,
                                                              [FromRoute] int customerId,
                                                              CancellationToken cancellationToken = default)
        {
            try
            {
                var apiResponse = await _bankAccountService.ActivateBankAccountAsync(accountId, cancellationToken);

                if (apiResponse.Success)
                {
                    return(Ok(apiResponse));
                }

                else if (apiResponse.Errors[0].Code == StatusCodes.Status404NotFound)
                {
                    return(BadRequest(apiResponse));
                }


                return(BadRequest(apiResponse));
            }
            catch (Exception exception)
            {
                return(_actionResultMapper.Map(exception));
            }
        }