Ejemplo n.º 1
0
        public void Consume(BetWon @event)
        {
            var statistics = GetPlayerBetStatistics(@event.PlayerId);

            statistics.TotalWon += @event.Amount;
            _playerRepository.SaveChanges();
        }
Ejemplo n.º 2
0
 public void Handle(BetWon @event)
 {
     EngageWalletChanges(
         @event.PlayerId,
         (wallet, repository) =>
     {
         var transaction = wallet.WinBet(@event.RoundId, @event.Amount, @event.GameActionId);
         HandlePositiveTurnover(@event, repository, wallet, transaction);
     });
 }
Ejemplo n.º 3
0
        public void Handle(BetWon wonEvent)
        {
            var reportRepository = _reportRepositoryFactory();
            var record           = GetBetHistoryRecordOrNull(reportRepository, wonEvent.RoundId);

            if (record == null)
            {
                throw new RegoException(string.Format(BetHistoryRecordNotFoundMessage, wonEvent.RoundId));
            }

            record.TotalWinLoss += wonEvent.Amount;
            reportRepository.SaveChanges();
        }
Ejemplo n.º 4
0
 public void Consume(BetWon message)
 {
     _eventHandlers.Handle(message);
 }
Ejemplo n.º 5
0
 public void Consume(BetWon message)
 {
     _gameSubscriber.Handle(message);
 }