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); }
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; }
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); }
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); }
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); }
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); }
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); }
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); }
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; } }
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); }
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); }
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(); }
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); }
/// <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(); } }
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; }
public void Test_Name() { VerificationStep procedureStep = new VerificationStep(); Assert.AreEqual("Verification", procedureStep.Name); }
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); }
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; }
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; }
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);
public async Task InvokeVerificationStepAsync(VerificationProcess process, VerificationStep step) => await VerificationStep.Invoke(process, step).ConfigureAwait(false);