private string GetEnumDescription(VerificationStep step)
        {
            var type       = typeof(VerificationStep);
            var memInfo    = type.GetMember(step.ToString());
            var attributes = memInfo[0].GetCustomAttributes(typeof(DescriptionAttribute), false);

            return(((DescriptionAttribute)attributes[0]).Description);
        }
Ejemplo n.º 2
0
			protected PublicationStep CreateScheduledPublicationStep(Staff executingStaff, VerificationStep verification)
			{
				var settings = new ReportingWorkflowSettings();

				var publication = new PublicationStep(verification);
				publication.Assign(executingStaff);
				publication.Schedule(Platform.Time.AddSeconds(settings.PublicationDelay));

				return publication;
			}
Ejemplo n.º 3
0
            public void Execute(VerificationStep step, Staff executingStaff, IWorkflow workflow)
            {
                // if not assigned, assign
                if (step.AssignedStaff == null)
                {
                    step.Assign(executingStaff);
                }

                // put in-progress
                step.Start(executingStaff);
            }
Ejemplo n.º 4
0
            public PublicationStep Execute(VerificationStep step, Staff executingStaff, IWorkflow workflow)
            {
                // this operation is legal even if the step was never started, therefore need to supply the performer
                step.Complete(executingStaff);

                var publicationStep = CreateScheduledPublicationStep(executingStaff, step);

                workflow.AddEntity(publicationStep);

                return(publicationStep);
            }
Ejemplo n.º 5
0
            public ReportingProcedureStep Execute(ReportingProcedureStep step, Staff executingStaff, IWorkflow workflow)
            {
                UpdateStep(step, executingStaff);

                var verificationStep = new VerificationStep(step);

                // supervisor can be null, in which case the verification step is unassigned.
                verificationStep.Assign(step.ReportPart.Supervisor);

                workflow.AddEntity(verificationStep);
                return(verificationStep);
            }
Ejemplo n.º 6
0
        public void Test_Complete()
        {
            Procedure procedure = new Procedure();
            Report report = new Report(procedure);
            ReportPart reportPart = new ReportPart(report, 0);
            Staff performer = new Staff();
            InterpretationStep previousStep = new InterpretationStep(procedure);
            previousStep.ReportPart = reportPart;
            VerificationStep procedureStep = new VerificationStep(previousStep);
            procedureStep.Start(performer);

            procedureStep.Complete();

            Assert.AreEqual(performer, procedureStep.ReportPart.Verifier);
        }
Ejemplo n.º 7
0
 private void ExecuteVerificationStep(VerificationStep step)
 {
     if (step.Assertion != null)
     {
         Console.WriteLine($"UI Element = {step.ElementId}, Expected Data = {step.ExpectedData}, Assertion = { step.Assertion}.");
         if (step.ExpectedDataArray == null)
         {
             step.Assertion.Verify(WebDriver, step.ElementId, step.ExpectedData);
         }
         else
         {
             step.Assertion.Verify(WebDriver, step.ElementId, step.ExpectedDataArray);
         }
     }
 }
        /// <summary>
        /// Based on the step, operation, criteria value and actual value, this method returns an object
        /// that contains full rule description and actual value for that rule which will be stored into the DB.
        /// </summary>
        /// <param name="step">DepositCount, AccountAge, WithdrawalCount etc.</param>
        /// <param name="op">LessOrEqual, Is, Of etc.</param>
        /// <param name="ruleValue">Tha value for the rule as it is in the criteria</param>
        /// <param name="actualValue">Actual value for that rule coming from the WD request</param>
        /// <returns></returns>
        protected CompleteRuleDescriptionAndActualValue GenerateFullRuleDescriptionAndValue(
            VerificationStep step, ComparisonEnum op, string ruleValue, string actualValue)
        {
            var enumDescription    = GetEnumDescription(step);
            var comparisonOperator = GetOperatorAsString(op);

            var result = new CompleteRuleDescriptionAndActualValue()
            {
                CompleteRuleDescription = string.Format("{0} {1}", enumDescription, comparisonOperator),
                RuleRequiredValues      = ruleValue,
                ActualVerificationValue = actualValue
            };

            return(result);
        }
Ejemplo n.º 9
0
            public ReportingProcedureStep Execute(ReportingProcedureStep step, Staff executingStaff, IWorkflow workflow)
            {
                UpdateStep(step, executingStaff);

                var verificationStep = new VerificationStep(step);

                verificationStep.Assign(executingStaff);
                verificationStep.Complete(executingStaff);
                workflow.AddEntity(verificationStep);

                var publicationStep = CreateScheduledPublicationStep(executingStaff, verificationStep);

                workflow.AddEntity(publicationStep);

                return(publicationStep);
            }
Ejemplo n.º 10
0
        protected override void OnRuleFinish(bool result, Guid withdrawalId, VerificationStep step, CompleteRuleDescriptionAndActualValue metadata = null)
        {
            _logsCommands.LogWithdrawalVerificationStep(
                withdrawalId,
                result,
                VerificationType.AutoVerification,
                step,
                metadata.CompleteRuleDescription,
                metadata.RuleRequiredValues,
                metadata.ActualVerificationValue);

            if (!result)
            {
                Failed = true;
            }
        }
Ejemplo n.º 11
0
        public void Test_Complete()
        {
            Procedure          procedure    = new Procedure();
            Report             report       = new Report(procedure);
            ReportPart         reportPart   = new ReportPart(report, 0);
            Staff              performer    = new Staff();
            InterpretationStep previousStep = new InterpretationStep(procedure);

            previousStep.ReportPart = reportPart;
            VerificationStep procedureStep = new VerificationStep(previousStep);

            procedureStep.Start(performer);

            procedureStep.Complete();

            Assert.AreEqual(performer, procedureStep.ReportPart.Verifier);
        }
Ejemplo n.º 12
0
            public InterpretationStep Execute(VerificationStep step, Staff executingStaff, IWorkflow workflow)
            {
                // Cancel the current step
                step.Discontinue();

                // Create a new interpreatation step that uses the same report part
                var interpretationStep = new InterpretationStep(step);

                // Reset the interpretator
                interpretationStep.ReportPart.Interpreter = executingStaff;

                // Assign the new step to the resident
                interpretationStep.Assign(executingStaff);
                interpretationStep.Start(executingStaff);

                workflow.AddEntity(interpretationStep);
                return(interpretationStep);
            }
Ejemplo n.º 13
0
        public void Test_Reassign()
        {
            Procedure procedure = new Procedure();
            Report report = new Report(procedure);
            ReportPart reportPart = new ReportPart(report, 0);
            Staff performer = new Staff();
            reportPart.Supervisor = new Staff();
            VerificationStep procedureStep = new VerificationStep();
            procedureStep.Procedure = procedure;
            procedureStep.ReportPart = reportPart;
            Assert.IsNotNull(procedureStep.ReportPart);

            VerificationStep newStep = (VerificationStep)procedureStep.Reassign(performer);

            Assert.AreEqual(performer, newStep.ReportPart.Supervisor);
            Assert.AreEqual(procedureStep, newStep);
            Assert.IsInstanceOf(typeof(VerificationStep), newStep);
        }
Ejemplo n.º 14
0
        protected override void OnRuleFinish(bool result, Guid withdrawalId, VerificationStep step, CompleteRuleDescriptionAndActualValue metadata = null)
        {
            _logsCommands.LogWithdrawalVerificationStep(
                withdrawalId,
                result,
                VerificationType.RiskProfileCheck,
                step,
                metadata != null ? metadata.CompleteRuleDescription : "-",
                metadata != null ? metadata.RuleRequiredValues : "-",
                metadata != null ? metadata.ActualVerificationValue : "-"
                );

            var withdrawal = _paymentRepository.OfflineWithdraws
                             .Single(o => o.Id == withdrawalId);

            withdrawal.RiskLevelStatus    = RiskResultConverter.GetStatusForRpc(result, step);
            withdrawal.RiskLevelCheckDate = DateTimeOffset.UtcNow;

            _paymentRepository.SaveChanges();
        }
Ejemplo n.º 15
0
        public void Test_Reassign()
        {
            Procedure  procedure  = new Procedure();
            Report     report     = new Report(procedure);
            ReportPart reportPart = new ReportPart(report, 0);
            Staff      performer  = new Staff();

            reportPart.Supervisor = new Staff();
            VerificationStep procedureStep = new VerificationStep();

            procedureStep.Procedure  = procedure;
            procedureStep.ReportPart = reportPart;
            Assert.IsNotNull(procedureStep.ReportPart);

            VerificationStep newStep = (VerificationStep)procedureStep.Reassign(performer);

            Assert.AreEqual(performer, newStep.ReportPart.Supervisor);
            Assert.AreEqual(procedureStep, newStep);
            Assert.IsInstanceOfType(typeof(VerificationStep), newStep);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// The way we determine the actual status for that RPC rule is as follows:
        /// RiskProfileCheckValidationService:
        /// -ValidateBonus(Failed -> High)
        /// -ValidatePaymentMethod(Failed -> High)
        /// -ValidateWithdrawalAveragePercentageChange(Failed -> High)
        /// -ValidateWinningsToDepositPercentageIncrease(Failed -> High)
        /// -ValidateAccountAge(Failed -> Low)
        /// -ValidateTotalWithdrawalCount(Failed -> Low)
        /// -ValidatePlayersFraudRiskLevel(Failed -> Low)
        /// -ValidateWinLossRule(Failed -> Low)
        /// </summary>
        /// <param name="isSuccess"></param>
        /// <param name="step"></param>
        public static FraudRiskLevelStatus GetStatusForRpc(bool isSuccess, VerificationStep step)
        {
            if (isSuccess && CommonVerificationSteps.Contains(step))
            {
                return(FraudRiskLevelStatus.High);
            }
            if (isSuccess && !CommonVerificationSteps.Contains(step))
            {
                return(FraudRiskLevelStatus.Low);
            }
            if (!isSuccess && CommonVerificationSteps.Contains(step))
            {
                return(FraudRiskLevelStatus.Low);
            }
            if (!isSuccess && !CommonVerificationSteps.Contains(step))
            {
                return(FraudRiskLevelStatus.High);
            }

            return(FraudRiskLevelStatus.Low);
        }
        public void LogWithdrawalVerificationStep(Guid withdrawalId, bool isSuccess, VerificationType type,
                                                  VerificationStep step, string completeRuleDesc, string ruleRequiredValues, string criteriaActualValue)
        {
            using (var scope = CustomTransactionScope.GetTransactionScope())
            {
                var withdrawalVerificationLog = new WithdrawalVerificationLog
                {
                    Id                = Guid.NewGuid(),
                    IsSuccess         = isSuccess,
                    VerificationStep  = step,
                    VerificationType  = type,
                    WithdrawalId      = withdrawalId,
                    VerificationRule  = completeRuleDesc,
                    RuleRequiredValue = ruleRequiredValues,
                    CurrentValue      = criteriaActualValue
                };

                _repository.WithdrawalVerificationLogs.Add(withdrawalVerificationLog);
                _repository.SaveChanges();
                scope.Complete();
            }
        }
Ejemplo n.º 18
0
			public PublicationStep Execute(VerificationStep step, Staff executingStaff, IWorkflow workflow)
			{
				// this operation is legal even if the step was never started, therefore need to supply the performer
				step.Complete(executingStaff);

				var publicationStep = CreateScheduledPublicationStep(executingStaff, step);
				workflow.AddEntity(publicationStep);

				return publicationStep;
			}
Ejemplo n.º 19
0
        public void Test_Name()
        {
            VerificationStep procedureStep = new VerificationStep();

            Assert.AreEqual("Verification", procedureStep.Name);
        }
Ejemplo n.º 20
0
            protected PublicationStep CreateScheduledPublicationStep(Staff executingStaff, VerificationStep verification)
            {
                var settings = new ReportingWorkflowSettings();

                var publication = new PublicationStep(verification);

                publication.Assign(executingStaff);
                publication.Schedule(Platform.Time.AddSeconds(settings.PublicationDelay));

                return(publication);
            }
Ejemplo n.º 21
0
			public ReportingProcedureStep Execute(ReportingProcedureStep step, Staff executingStaff, IWorkflow workflow)
			{
				UpdateStep(step, executingStaff);

				var verificationStep = new VerificationStep(step);

				// supervisor can be null, in which case the verification step is unassigned.
				verificationStep.Assign(step.ReportPart.Supervisor);

				workflow.AddEntity(verificationStep);
				return verificationStep;
			}
Ejemplo n.º 22
0
			public ReportingProcedureStep Execute(ReportingProcedureStep step, Staff executingStaff, IWorkflow workflow)
			{
				UpdateStep(step, executingStaff);

				var verificationStep = new VerificationStep(step);
				verificationStep.Assign(executingStaff);
				verificationStep.Complete(executingStaff);
				workflow.AddEntity(verificationStep);

				var publicationStep = CreateScheduledPublicationStep(executingStaff, verificationStep);
				workflow.AddEntity(publicationStep);

				return publicationStep;
			}
Ejemplo n.º 23
0
			public InterpretationStep Execute(VerificationStep step, Staff executingStaff, IWorkflow workflow)
			{
				// Cancel the current step
				step.Discontinue();

				// Create a new interpreatation step that uses the same report part
				var interpretationStep = new InterpretationStep(step);

				// Reset the interpretator
				interpretationStep.ReportPart.Interpreter = executingStaff;

				// Assign the new step to the resident
				interpretationStep.Assign(executingStaff);
				interpretationStep.Start(executingStaff);

				workflow.AddEntity(interpretationStep);
				return interpretationStep;
			}
 protected abstract void OnRuleFinish(bool result, Guid withdrawalId, VerificationStep step, CompleteRuleDescriptionAndActualValue metadata = null);
Ejemplo n.º 25
0
			public void Execute(VerificationStep step, Staff executingStaff, IWorkflow workflow)
			{
				// if not assigned, assign
				if (step.AssignedStaff == null)
				{
					step.Assign(executingStaff);
				}

				// put in-progress
				step.Start(executingStaff);
			}
Ejemplo n.º 26
0
        public void Test_Name()
        {
            VerificationStep procedureStep = new VerificationStep();

            Assert.AreEqual("Verification", procedureStep.Name);
        }
Ejemplo n.º 27
0
 public async Task InvokeVerificationStepAsync(VerificationProcess process, VerificationStep step)
 => await VerificationStep.Invoke(process, step).ConfigureAwait(false);