Beispiel #1
0
        private string[] GetQualificationFailures(QualificationPhase phase)
        {
            var bonus  = new Bonus(Data.Bonus);
            var player = new Player(Data.Player);

            return(bonus.QualifyFor(player, phase, Data.Parameters).ToArray());
        }
Beispiel #2
0
        public IEnumerable <string> CheckForQualificationFailures(Player player, QualificationPhase phase, decimal depositAmount)
        {
            foreach (var qualificationFailure in CheckForQualificationFailures(player, phase))
            {
                yield return(qualificationFailure);
            }

            if (phase == QualificationPhase.PreRedemption || phase == QualificationPhase.Redemption)
            {
                if (Data.Template.Info.TemplateType == BonusType.HighDeposit)
                {
                    var highDepositAmount = player.MonthlyAccumulatedDepositAmount;
                    if (HighDepositTiersDoNotSatisfy(player.Data.CurrencyCode, highDepositAmount))
                    {
                        yield return(QualificationReasons.HighDepositTierNotFound);
                    }
                    else if (PlayerRedeemedAllHighDepositTiers(player, highDepositAmount))
                    {
                        yield return(QualificationReasons.AllHighDepositRewardsAreRedeemedThisMonth);
                    }
                }
                else
                {
                    if (IsIssuedByCs == false)
                    {
                        if (player.DepositQuailifiedBonusType != Data.Template.Info.TemplateType)
                        {
                            yield return($"Player is not qualified for {Data.Template.Info.TemplateType} bonus");
                        }
                    }
                }
            }

            if (Data.Template.Info.TemplateType == BonusType.FirstDeposit || Data.Template.Info.TemplateType == BonusType.ReloadDeposit)
            {
                if (phase == QualificationPhase.Redemption || phase == QualificationPhase.Activation)
                {
                    if (BonusTiersDoNotSatisfy(player.Data.CurrencyCode, depositAmount))
                    {
                        yield return(QualificationReasons.DepositAmountIsNotQualifiedForTheBonus);
                    }
                }
            }
        }
Beispiel #3
0
        public IEnumerable <string> QualifyFor(Player player, QualificationPhase phase, RedemptionParams redemptionParams)
        {
            var bonusType = Data.Template.Info.TemplateType;

            if (bonusType == BonusType.FirstDeposit || bonusType == BonusType.ReloadDeposit ||
                bonusType == BonusType.HighDeposit)
            {
                return(new DepositQualificationCriteria(this, redemptionParams.IsIssuedByCs).CheckForQualificationFailures(player, phase, redemptionParams.TransferAmount));
            }
            if (bonusType == BonusType.FundIn)
            {
                return(new FundInQualificationCriteria(this, redemptionParams.IsIssuedByCs).CheckForQualificationFailures(player, phase, redemptionParams));
            }
            if (bonusType == BonusType.MobilePlusEmailVerification)
            {
                return
                    (new MobileEmailVerificationQualificationCriteria(this, redemptionParams.IsIssuedByCs)
                     .CheckForQualificationFailures(player, phase));
            }

            return(new BaseQualificationCriteria(this, redemptionParams.IsIssuedByCs).CheckForQualificationFailures(player, phase));
        }
Beispiel #4
0
        public IEnumerable <string> CheckForQualificationFailures(Player player, QualificationPhase phase, RedemptionParams redemptionParams)
        {
            foreach (var qualificationFailure in base.CheckForQualificationFailures(player, phase))
            {
                yield return(qualificationFailure);
            }

            if ((phase == QualificationPhase.PreRedemption && IsIssuedByCs == false) || phase == QualificationPhase.Redemption)
            {
                if (FundInWalletIsNotQualified(redemptionParams.TransferWalletTemplateId.Value))
                {
                    yield return(QualificationReasons.FundInWalletIsNotQualifiedForThisBonus);
                }
            }

            if (phase == QualificationPhase.Redemption || phase == QualificationPhase.Activation)
            {
                if (BonusTiersDoNotSatisfy(player.Data.CurrencyCode, redemptionParams.TransferAmount))
                {
                    yield return(QualificationReasons.FundInAmountIsNotQualifiedForThisBonus);
                }
            }
        }
Beispiel #5
0
 public bool QualifiesFor(Player player, QualificationPhase phase, RedemptionParams redemptionParams)
 {
     return(QualifyFor(player, phase, redemptionParams).Any() == false);
 }
Beispiel #6
0
        public override IEnumerable <string> CheckForQualificationFailures(Player player, QualificationPhase phase)
        {
            foreach (var qualificationFailure in base.CheckForQualificationFailures(player, phase))
            {
                yield return(qualificationFailure);
            }

            if (phase == QualificationPhase.Activation)
            {
                if (MobileNumberIsntVerified(player))
                {
                    yield return(QualificationReasons.MobileNumberIsNotVerified);
                }
                if (EmailIsntVerified(player))
                {
                    yield return(QualificationReasons.EmailAddressIsNotVerified);
                }
            }
            else if (phase == QualificationPhase.PreRedemption || phase == QualificationPhase.Redemption)
            {
                if (IsMobilePlusEmailVerificationBonusRedemptionExist(player))
                {
                    yield return(QualificationReasons.OneVerificationBonusRedemptionPerPlayerIsAllowed);
                }
            }
        }
Beispiel #7
0
        public virtual IEnumerable <string> CheckForQualificationFailures(Player player, QualificationPhase phase)
        {
            if (Data.IsActive == false)
            {
                yield return(QualificationReasons.BonusIsDeactivated);
            }

            if (IsIssuedByCs == false && player.Data.IsFraudulent)
            {
                yield return(QualificationReasons.BonusesForPlayerAreDisabled);
            }

            if (phase == QualificationPhase.Claim)
            {
                if (IsIssuedByCs == false)
                {
                    if (ClaimDurationIsOver())
                    {
                        yield return(QualificationReasons.PlayerCannotClaimBonusOutsideOfClaimDurationPeriod);
                    }
                }
            }
            else
            {
                if (IsPlayerInExcludeRiskLevel(player))
                {
                    yield return(QualificationReasons.PlayerIsInExcludedRiskLevel);
                }
                if (IsExcludeBonusesAlreadyRedeemed(player))
                {
                    yield return(QualificationReasons.OneOfTheDisqualifyingBonusesWasAlreadyRedeemed);
                }
                if (IsOverPlayerRedemptionLimit(player))
                {
                    yield return(QualificationReasons.BonusReachedMaximuRredemptionLimit);
                }
            }

            if (phase == QualificationPhase.Redemption || phase == QualificationPhase.PreRedemption)
            {
                if (BonusIsNotActive(IsIssuedByCs))
                {
                    yield return(QualificationReasons.BonusIsNotActive);
                }

                if (IsIssuedByCs == false)
                {
                    if (ApplyDurationIsOver())
                    {
                        yield return(QualificationReasons.PlayerCannotApplyForBonusOutsideOfApplicationPeriod);
                    }
                }

                if (PlayersCurrencyIsNotQualified(player))
                {
                    yield return(QualificationReasons.CurrencyIsNotQualifiedForThisBonus);
                }
                if (IsParentBonusWasNotActivated(player))
                {
                    yield return(QualificationReasons.ParentBonusWasNotActivated);
                }

                if (IsOverRedemptionsLimit())
                {
                    yield return(QualificationReasons.BonusReachedMaximumPlayerRedemptionsLimit);
                }
                if (IsOverBonusRewardLimit(player))
                {
                    yield return(QualificationReasons.BonusReachedMaximumRewardLimit);
                }

                if (!PlayerHasAllowedVipLevel(player))
                {
                    yield return(QualificationReasons.VIPLevelIsNotQualifiedForThisBonus);
                }
                if (PlayerRegistrationDateDoesNotSatisfy(player.Data.DateRegistered))
                {
                    yield return(QualificationReasons.RegistrationDateIsNotQualifiedForThisBonus);
                }
                if (PlayerWithinRegistrationDaysDoesNotSatisfy(player.Data.DateRegistered))
                {
                    yield return(QualificationReasons.BonusIsQualifiedWithinXRegistrationDays);
                }
            }
        }