예제 #1
0
        public void ClaimBonusRedemption(ClaimBonusRedemption model)
        {
            using (var scope = CustomTransactionScope.GetTransactionScope())
            {
                var validationResult = _bonusQueries.GetValidationResult(model);
                if (validationResult.IsValid == false)
                {
                    throw new RegoException(validationResult.Errors.First().ErrorMessage);
                }

                var redemption = _repository.GetBonusRedemption(model.PlayerId, model.RedemptionId);
                ClaimBonusRedemption(redemption);
                _repository.SaveChanges();

                redemption.Events.ForEach(_eventBus.Publish);
                scope.Complete();
            }
        }
예제 #2
0
        public BonusRedemption GetBonusRedemption(Guid playerId, Guid redemptionId)
        {
            var redemption = _repository.GetBonusRedemption(playerId, redemptionId).Data;

            return(Mapper.Map <BonusRedemption>(redemption));
        }