public void FailInvestigation(OfflineWithdrawId id, string remarks) { using (var scope = CustomTransactionScope.GetTransactionScope()) { var withdrawal = GetWithdrawalWithPlayer(id); withdrawal.InvestigatedBy = _actorInfoProvider.Actor.UserName; withdrawal.InvestigationDate = DateTimeOffset.Now.ToBrandOffset(withdrawal.PlayerBankAccount.Player.Brand.TimezoneId); withdrawal.Remarks = remarks; withdrawal.Status = WithdrawalStatus.Unverified; _serviceBus.PublishMessage(new WithdrawRequestCancel { WithdrawId = id, ActorName = _actorInfoProvider.Actor.UserName, CanceledUserId = _actorInfoProvider.Actor.Id, Status = WithdrawalStatus.Unverified, Remarks = remarks }); _repository.SaveChanges(); scope.Complete(); } }
public void Revert(OfflineWithdrawId id, string remarks) { using (var scope = CustomTransactionScope.GetTransactionScope()) { var withdrawal = GetWithdrawalWithPlayer(id); if (withdrawal.Status != WithdrawalStatus.Verified) { ThrowStatusError(withdrawal.Status, WithdrawalStatus.Reverted); } withdrawal.Remarks = remarks; withdrawal.Status = WithdrawalStatus.Reverted; withdrawal.RevertedBy = _actorInfoProvider.Actor.UserName; withdrawal.RevertedTime = DateTimeOffset.Now.ToBrandOffset(withdrawal.PlayerBankAccount.Player.Brand.TimezoneId); _eventBus.Publish(new WithdrawalReverted( id, withdrawal.Amount, withdrawal.RevertedTime.Value, _actorInfoProvider.Actor.Id, withdrawal.PlayerBankAccount.Player.Id, WithdrawalStatus.Reverted, remarks, withdrawal.TransactionNumber, _actorInfoProvider.Actor.UserName) { EventCreated = withdrawal.RevertedTime.Value, }); _repository.SaveChanges(); scope.Complete(); } }
public void FailWager(OfflineWithdrawId id, string remarks) { var withdrawal = GetWithdrawalWithPlayer(id); using (var scope = CustomTransactionScope.GetTransactionScope()) { withdrawal.WagerCheck = false; withdrawal.Remarks = remarks; AppendWagerCheckComments(withdrawal, _actorInfoProvider.Actor.UserName); withdrawal.Status = WithdrawalStatus.Unverified; _serviceBus.PublishMessage(new WithdrawRequestCancel { WithdrawId = id, ActorName = _actorInfoProvider.Actor.UserName, CanceledUserId = _actorInfoProvider.Actor.Id, Status = WithdrawalStatus.Unverified, Remarks = remarks }); _repository.SaveChanges(); scope.Complete(); } }
public void PassInvestigation(OfflineWithdrawId id, string remarks) { using (var scope = CustomTransactionScope.GetTransactionScope()) { var offlineWithdrawal = GetWithdrawalWithPlayer(id); offlineWithdrawal.InvestigatedBy = _actorInfoProvider.Actor.UserName; offlineWithdrawal.InvestigationDate = DateTimeOffset.Now.ToBrandOffset(offlineWithdrawal.PlayerBankAccount.Player.Brand.TimezoneId); offlineWithdrawal.Remarks = remarks; offlineWithdrawal.Status = WithdrawalStatus.Verified; _eventBus.Publish(new WithdrawalInvestigated( id, offlineWithdrawal.Amount, offlineWithdrawal.InvestigationDate.Value, _actorInfoProvider.Actor.Id, offlineWithdrawal.PlayerBankAccount.Player.Id, WithdrawalStatus.Investigation, remarks, offlineWithdrawal.TransactionNumber) { EventCreated = offlineWithdrawal.InvestigationDate.Value, }); _repository.SaveChanges(); scope.Complete(); } }
public void Approve(OfflineWithdrawId id, string remarks) { var offlineWithdrawal = GetWithdrawalWithPlayer(id); if (offlineWithdrawal.Status != WithdrawalStatus.Accepted) { ThrowStatusError(offlineWithdrawal.Status, WithdrawalStatus.Approved); } var now = _paymentQueries.GetBrandDateTimeOffset(offlineWithdrawal.PlayerBankAccount.Player.BrandId); _serviceBus.PublishMessage( new WithdrawRequestApprove { ActorName = _actorInfoProvider.Actor.UserName, WithdrawId = id, Remarks = remarks, ApprovedUerId = _actorInfoProvider.Actor.Id, Approved = now }); _messageTemplateService.TrySendPlayerMessage( offlineWithdrawal.PlayerBankAccount.Player.Id, MessageType.WithdrawalRequestReleased, MessageDeliveryMethod.Email, null); }
public void Unverify(OfflineWithdrawId id, string remarks) { var withdrawal = _repository.OfflineWithdraws.Include(x => x.PlayerBankAccount.Player).Single(x => x.Id == id); if (withdrawal.Status != WithdrawalStatus.AutoVerificationFailed && withdrawal.Status != WithdrawalStatus.Reverted && withdrawal.Status != WithdrawalStatus.Investigation && withdrawal.Status != WithdrawalStatus.Documents) { ThrowStatusError(withdrawal.Status, WithdrawalStatus.Unverified); } var now = _paymentQueries.GetBrandDateTimeOffset(withdrawal.PlayerBankAccount.Player.BrandId); _serviceBus.PublishMessage(new WithdrawRequestCancel { WithdrawId = id, ActorName = _actorInfoProvider.Actor.UserName, CanceledUserId = _actorInfoProvider.Actor.Id, Status = WithdrawalStatus.Unverified, Remarks = remarks, Canceled = now }); }
public void Verify(OfflineWithdrawId id, string remarks) { using (var scope = CustomTransactionScope.GetTransactionScope()) { var offlineWithdrawal = GetWithdrawalWithPlayer(id); if (offlineWithdrawal.Status != WithdrawalStatus.AutoVerificationFailed && offlineWithdrawal.Status != WithdrawalStatus.Reverted && offlineWithdrawal.Status != WithdrawalStatus.Investigation && offlineWithdrawal.Status != WithdrawalStatus.Documents) { ThrowStatusError(offlineWithdrawal.Status, WithdrawalStatus.Verified); } if (offlineWithdrawal.Status == WithdrawalStatus.Investigation) { offlineWithdrawal.InvestigationStatus = CommonVerificationStatus.Passed; offlineWithdrawal.InvestigationDate = DateTimeOffset.UtcNow; } if (offlineWithdrawal.Status == WithdrawalStatus.Documents) { offlineWithdrawal.DocumentsCheckStatus = CommonVerificationStatus.Passed; offlineWithdrawal.DocumentsCheckDate = DateTimeOffset.UtcNow; } offlineWithdrawal.Verified = DateTimeOffset.Now.ToBrandOffset(offlineWithdrawal.PlayerBankAccount.Player.Brand.TimezoneId); offlineWithdrawal.VerifiedBy = _actorInfoProvider.Actor.UserName; offlineWithdrawal.Remarks = remarks; offlineWithdrawal.Status = WithdrawalStatus.Verified; _eventBus.Publish(new WithdrawalVerified( id, offlineWithdrawal.Amount, offlineWithdrawal.Verified.Value, _actorInfoProvider.Actor.Id, offlineWithdrawal.PlayerBankAccount.Player.Id, WithdrawalStatus.Verified, remarks, offlineWithdrawal.TransactionNumber, _actorInfoProvider.Actor.UserName) { EventCreated = offlineWithdrawal.Verified.Value }); _repository.SaveChanges(); scope.Complete(); } }
public void Reject(OfflineWithdrawId id, string remarks) { using (var scope = CustomTransactionScope.GetTransactionScope()) { var withdrawal = GetWithdrawalWithPlayer(id); if (withdrawal.Status != WithdrawalStatus.Accepted) { ThrowStatusError(withdrawal.Status, WithdrawalStatus.Rejected); } withdrawal.Remarks = remarks; withdrawal.Status = WithdrawalStatus.Rejected; withdrawal.Rejected = DateTimeOffset.Now.ToBrandOffset(withdrawal.PlayerBankAccount.Player.Brand.TimezoneId); withdrawal.RejectedBy = _actorInfoProvider.Actor.UserName; _repository.SaveChanges(); scope.Complete(); } }
public void PassWager(OfflineWithdrawId id, string remarks) { using (var scope = CustomTransactionScope.GetTransactionScope()) { var offlineWithdrawal = GetWithdrawalWithPlayer(id); offlineWithdrawal.WagerCheck = true; offlineWithdrawal.Remarks = remarks; AppendWagerCheckComments(offlineWithdrawal, _actorInfoProvider.Actor.UserName); //_eventBus.Publish(new WithdrawalWagerChecked( // offlineWithdrawal.Id, // offlineWithdrawal.Amount, // DateTime.Now, // _actorInfoProvider.Actor.Id, // WithdrawalStatus.Investigation, // remarks, // offlineWithdrawal.TransactionNumber)); _repository.SaveChanges(); scope.Complete(); } }
public void Cancel(OfflineWithdrawId id, string remarks) { var withdrawal = GetWithdrawalWithPlayer(id); if (withdrawal == null) { return; } var now = _paymentQueries.GetBrandDateTimeOffset(withdrawal.PlayerBankAccount.Player.BrandId); _serviceBus.PublishMessage(new WithdrawRequestCancel { WithdrawId = id, ActorName = _actorInfoProvider.Actor.UserName, CanceledUserId = _actorInfoProvider.Actor.Id, Status = WithdrawalStatus.Canceled, Remarks = remarks, Canceled = now }); }