public ActionResult Investigate(Guid requestId, string remarks) { try { _service.SetInvestigateState(requestId, remarks); return(this.Success("app:payment.withdraw.successfullyTaggedInvestigate")); } catch (Exception exception) { return(this.Failed(exception)); } }
public async Task Can_verify_investigation_withdrawal_request() { var player = _player; _walletRepository.SaveChanges(); _paymentTestHelper.MakeDeposit(player.Id, 1000); await _gamesTestHelper.PlaceAndWinBet(1000, 10000, player.Id); Balance.Main = 10000; var response = _paymentTestHelper.MakeWithdraw(player.Id, _actorInfoProvider.Actor.UserName, 100); //assert balance after request _paymentTestHelper.AssertBalance(_player.Id , total: 10000, playable: 9900, main: 9900, free: 9900, withdrawalLock: 100); //have to revert withdraw,before verify var revertRemarks = TestDataGenerator.GetRandomString(10); _withdrawalService.Revert(response.Id, revertRemarks); var investigateRemarks = TestDataGenerator.GetRandomString(10); _withdrawalService.SetInvestigateState(response.Id, investigateRemarks); //assert balance after SetInvestigateState _paymentTestHelper.AssertBalance(_player.Id , total: 10000, playable: 9900, main: 9900, free: 9900, withdrawalLock: 100); var withdraw = _paymentRepository.OfflineWithdraws.FirstOrDefault(x => x.Id == response.Id); withdraw.Status.Should().Be(WithdrawalStatus.Investigation); withdraw.InvestigationDate.Should().Be(null); withdraw.InvestigatedBy.Should().BeNull(); withdraw.Remarks.Should().Be(investigateRemarks); var verifyRemarks = TestDataGenerator.GetRandomString(10); _withdrawalService.Verify(response.Id, verifyRemarks); withdraw = _paymentRepository.OfflineWithdraws.FirstOrDefault(x => x.Id == response.Id); withdraw.Status.Should().Be(WithdrawalStatus.Verified); withdraw.Verified.Should().BeCloseTo(DateTimeOffset.Now, 60000); withdraw.VerifiedBy.Should().Be(_actorInfoProvider.Actor.UserName); withdraw.Remarks.Should().Be(verifyRemarks); withdraw.InvestigationDate.Should().BeCloseTo(DateTimeOffset.Now, 60000); withdraw.InvestigationStatus.Should().Be(CommonVerificationStatus.Passed); //withdraw.InvestigatedBy.Should().Be(_actorInfoProvider.Actor.UserName);//TBD:is not set in verify }
public void Withdrawal_goes_from_VQ_to_OHQ_after_investigation() { //Create a withdrawal in the "Verification Queue" var withdrawal = new OfflineWithdraw(); SetWithdrawalProperties(withdrawal, WithdrawalStatus.AutoVerificationFailed); //Move withdrawal to the "On Hold Queue" _withdrawalService.SetInvestigateState(_observedWithdrawalId, "Investigate withdrawal request."); //Assert that the withdrawal request was moved to the "On Hold Queue" var withdrawalsInTheOnHoldQueue = _withdrawalService.GetWithdrawalsOnHold(); Assert.IsTrue(withdrawalsInTheOnHoldQueue.Any(wd => wd.Id == _observedWithdrawalId)); }