Deduplication handling for wallets

This commit is contained in:
Inal Arsanukaev 2019-04-04 13:00:18 +03:00
parent 031793f45b
commit 035bf50245
8 changed files with 8 additions and 3 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>newway</artifactId>
<version>1.0.40-SNAPSHOT</version>
<version>1.0.41-SNAPSHOT</version>
<packaging>jar</packaging>
<name>newway</name>

View File

@ -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());
}

View File

@ -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());
}

View File

@ -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());
}

View File

@ -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());
}

View File

@ -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());
}

View File

@ -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());
}

View File

@ -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={}",