diff --git a/pom.xml b/pom.xml
index ec40337..6e96a4c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0
newway
- 1.0.40-SNAPSHOT
+ 1.0.41-SNAPSHOT
jar
newway
diff --git a/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/deposit/DepositCreatedHandler.java b/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/deposit/DepositCreatedHandler.java
index ee53793..5a9d68c 100644
--- a/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/deposit/DepositCreatedHandler.java
+++ b/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/deposit/DepositCreatedHandler.java
@@ -47,6 +47,7 @@ public class DepositCreatedHandler extends AbstractDepositHandler {
deposit.setDepositStatus(DepositStatus.pending);
deposit.setExternalId(change.getCreated().getExternalId());
+ depositDao.updateNotCurrent(event.getSource());
depositDao.save(deposit);
log.info("Deposit have been saved, eventId={}, depositId={}", event.getId(), event.getSource());
}
diff --git a/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/destination/DestinationCreatedHandler.java b/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/destination/DestinationCreatedHandler.java
index 906c9bf..77dea67 100644
--- a/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/destination/DestinationCreatedHandler.java
+++ b/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/destination/DestinationCreatedHandler.java
@@ -73,6 +73,7 @@ public class DestinationCreatedHandler extends AbstractDestinationHandler {
}
}
+ destinationDao.updateNotCurrent(event.getSource());
destinationDao.save(destination);
log.info("Destination have been saved, eventId={}, destinationId={}", event.getId(), event.getSource());
}
diff --git a/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/identity/IdentityChallengeCreatedHandler.java b/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/identity/IdentityChallengeCreatedHandler.java
index 91dd786..db52caf 100644
--- a/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/identity/IdentityChallengeCreatedHandler.java
+++ b/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/identity/IdentityChallengeCreatedHandler.java
@@ -65,8 +65,7 @@ public class IdentityChallengeCreatedHandler extends AbstractIdentityHandler {
challenge.setChallengeStatus(ChallengeStatus.pending);
}
-
-
+ challengeDao.updateNotCurrent(event.getSource(), challengeChange.getId());
challengeDao.save(challenge);
log.info("Start identity challenge have been created, eventId={}, identityId={}, challengeId={}", event.getId(), event.getSource(), challengeChange.getId());
}
diff --git a/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/source/SourceCreatedHandler.java b/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/source/SourceCreatedHandler.java
index 4d480a3..46c29be 100644
--- a/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/source/SourceCreatedHandler.java
+++ b/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/source/SourceCreatedHandler.java
@@ -49,6 +49,7 @@ public class SourceCreatedHandler extends AbstractSourceHandler {
source.setResourceInternalDetails(internal.getDetails());
}
+ sourceDao.updateNotCurrent(event.getSource());
sourceDao.save(source);
log.info("Source have been saved, eventId={}, sourceId={}", event.getId(), event.getSource());
}
diff --git a/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/wallet/WalletCreatedHandler.java b/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/wallet/WalletCreatedHandler.java
index 2bfea4b..c696639 100644
--- a/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/wallet/WalletCreatedHandler.java
+++ b/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/wallet/WalletCreatedHandler.java
@@ -39,6 +39,7 @@ public class WalletCreatedHandler extends AbstractWalletHandler {
wallet.setWalletName(change.getCreated().getName());
wallet.setExternalId(change.getCreated().getExternalId());
+ walletDao.updateNotCurrent(event.getSource());
walletDao.save(wallet);
log.info("Wallet have been saved, eventId={}, walletId={}", event.getId(), event.getSource());
}
diff --git a/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/withdrawal/WithdrawalCreatedHandler.java b/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/withdrawal/WithdrawalCreatedHandler.java
index f911997..70520ff 100644
--- a/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/withdrawal/WithdrawalCreatedHandler.java
+++ b/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/withdrawal/WithdrawalCreatedHandler.java
@@ -60,6 +60,7 @@ public class WithdrawalCreatedHandler extends AbstractWithdrawalHandler {
withdrawal.setCurrencyCode(cash.getCurrency().getSymbolicCode());
withdrawal.setWithdrawalStatus(WithdrawalStatus.pending);
+ withdrawalDao.updateNotCurrent(event.getSource());
withdrawalDao.save(withdrawal);
log.info("Withdrawal have been saved, eventId={}, walletId={}", event.getId(), event.getSource());
}
diff --git a/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/withdrawal_session/WithdrawalSessionCreatedHandler.java b/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/withdrawal_session/WithdrawalSessionCreatedHandler.java
index 54ee8d4..f6c5b3b 100644
--- a/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/withdrawal_session/WithdrawalSessionCreatedHandler.java
+++ b/src/main/java/com/rbkmoney/newway/poller/event_stock/impl/withdrawal_session/WithdrawalSessionCreatedHandler.java
@@ -60,6 +60,7 @@ public class WithdrawalSessionCreatedHandler extends AbstractWithdrawalSessionHa
withdrawalSession.setAmount(cash.getAmount());
withdrawalSession.setCurrencyCode(cash.getCurrency().getSymbolicCode());
+ withdrawalSessionDao.updateNotCurrent(event.getSource());
Long id = withdrawalSessionDao.save(withdrawalSession);
log.info("Withdrawal session have been saved: id={}, eventId={}, sessionId={}",