Exemplo n.º 1
0
        public async Task <IActionResult> RegisterTransaction(Guid id, [FromBody] RegisterTransactionRequest request, CancellationToken cancellationToken)
        {
            var transactionResponse = await _transactionResponseMemoryCache.GetOrCreateAsync(
                request.Id, () => _playerService.RegisterTransactionAsync(request.ToTransaction(id), cancellationToken))
                                      .ConfigureAwait(false);

            return(StatusCode(transactionResponse.ResponseStatusCode));
        }
Exemplo n.º 2
0
 public static Transaction ToTransaction(this RegisterTransactionRequest transaction, Guid playerId) =>
 new Transaction
 {
     Id              = transaction.Id,
     PlayerId        = playerId,
     Amount          = transaction.Amount,
     TransactionType = transaction.TransactionType.ToTransactionType()
 };