public async Task <TransactionDetailsResponse> ExecuteQueryAsync(TransactionDetailsQuery query) { if (query == null) { throw new ArgumentNullException(nameof(query)); } var transaction = await _transactionRepository.GetByTransactionIdAsync(query.TransactionId); return(new TransactionDetailsResponse( transaction.Account.AccountId, transaction.TransactionAmount, transaction.TransactionId, transaction.TransactionType, transaction.ProcessedOnDateTime.HasValue)); }
public void OneTimeSetup() { var Id1 = 0; var Id2 = -1; var transaction1 = new TransactionDetailsQuery() { Id = Id1, IncludeNavigationProperties = false }; var transaction2 = new TransactionDetailsQuery() { Id = Id2, IncludeNavigationProperties = false }; }
public async Task <ActionResult> GetTransactionDetailsAsync(string transactionId) { if (String.IsNullOrEmpty(transactionId)) { return(BadRequest("transactionId can not be null or empty")); } var query = new TransactionDetailsQuery(transactionId); var response = await _transactionQueryProcessor.ExecuteQueryAsync(query); if (response == null) { return(NotFound()); } return(Ok(response)); }