Пример #1
0
        public void Can_log_VIP_Level_Registered()
        {
            var @event = new VipLevelRegistered();

            _serviceBus.PublishMessage(@event);
            AssertAdminActivityLog(@event, AdminActivityLogCategory.VipLevel);
        }
Пример #2
0
        public void Handle(VipLevelRegistered registeredEvent)
        {
            var repository = _container.Resolve <IReportRepository>();
            var record     = repository.VipLevelRecords.FirstOrDefault(r => r.VipLevelId == registeredEvent.Id);

            if (record != null)
            {
                return;
            }
            var brand = _container.Resolve <BrandQueries>().GetBrandOrNull(registeredEvent.BrandId);

            record = new VipLevelRecord
            {
                Id         = Guid.NewGuid(),
                VipLevelId = registeredEvent.Id,
                Licensee   = brand.Licensee.Name,
                Brand      = brand.Name,
                Code       = registeredEvent.Code,
                Rank       = registeredEvent.Rank,
                Status     = registeredEvent.Status.ToString(),
                Created    = registeredEvent.EventCreated,
                CreatedBy  = registeredEvent.EventCreatedBy
            };
            if (registeredEvent.Status == VipLevelStatus.Active)
            {
                record.Activated   = registeredEvent.EventCreated;
                record.ActivatedBy = registeredEvent.EventCreatedBy;
            }
            repository.VipLevelRecords.Add(record);
            UpdateReportBetLimits(repository, record, registeredEvent.VipLevelLimits, registeredEvent.BrandId);
            repository.SaveChanges();
        }
Пример #3
0
        public void Consume(VipLevelRegistered @event)
        {
            _repository.VipLevels.Add(new VipLevel
            {
                Id             = @event.Id,
                BrandId        = @event.BrandId,
                VipLevelLimits = @event.VipLevelLimits.Select(x => new VipLevelGameProviderBetLimit
                {
                    VipLevelId     = x.VipLevelId,
                    BetLimitId     = x.BetLimitId,
                    GameProviderId = x.GameProviderId,
                    CurrencyCode   = x.CurrencyCode
                }).ToList()
            });

            var betLimitGroup = _repository.BetLimitGroups.SingleOrDefault(blg => blg.Name == @event.Name);

            if (betLimitGroup != null)
            {
                _repository.VipLevelBetLimitGroups.AddOrUpdate(new VipLevelBetLimitGroup()
                {
                    VipLevelId      = @event.Id,
                    BetLimitGroupId = betLimitGroup.Id
                });
            }

            _repository.SaveChanges();
        }
Пример #4
0
 public void Consume(VipLevelRegistered message)
 {
     _repository.VipLevels.Add(new VipLevel
     {
         Id   = message.Id,
         Name = message.Name
     });
     _repository.SaveChanges();
 }
Пример #5
0
        public void Consume(VipLevelRegistered @event)
        {
            var paymentRepository = _container.Resolve <IPaymentRepository>();

            paymentRepository.VipLevels.Add(new Data.VipLevel
            {
                Id      = @event.Id,
                Name    = @event.Name,
                BrandId = @event.BrandId
            });

            paymentRepository.SaveChanges();
        }
Пример #6
0
        public void Handle(VipLevelRegistered @event)
        {
            var bonusRepository = _container.Resolve <IBonusRepository>();

            var brand = bonusRepository.Brands.SingleOrDefault(b => b.Id == @event.BrandId);

            if (brand == null)
            {
                throw new RegoException(string.Format(NoBrandFormat, @event.BrandId));
            }

            brand.Vips.Add(new VipLevel {
                Code = @event.Code
            });
            bonusRepository.SaveChanges();
        }
        public void Consume(VipLevelRegistered message)
        {
            var repository = _container.Resolve <IFraudRepository>();

            repository.VipLevels.Add(new VipLevel
            {
                Id          = message.Id,
                BrandId     = message.BrandId,
                Code        = message.Code,
                Description = message.Description,
                Name        = message.Name,
                Status      = message.Status
            });

            repository.SaveChanges();
        }
 public void Consume(VipLevelRegistered message)
 {
     _eventHandlers.Handle(message);
 }
Пример #9
0
 public void Consume(VipLevelRegistered message)
 {
     _brandSubscriber.Handle(message);
 }
Пример #10
0
 public void Handle(VipLevelRegistered @event)
 {
     AddActivityLog(AdminActivityLogCategory.VipLevel, @event);
 }