final Map<String, Object> changes = account.activate(user, command, DateUtils.getLocalDateOfTenant());
if (!changes.isEmpty()) {
final Locale locale = command.extractLocale();
final DateTimeFormatter fmt = DateTimeFormat.forPattern(command.dateFormat()).withLocale(locale);
Money amountForDeposit = account.activateWithBalance();
if (amountForDeposit.isGreaterThanZero()) {
final PortfolioAccountData portfolioAccountData = this.accountAssociationsReadPlatformService
.retriveSavingsAssociation(savingsId);
if (portfolioAccountData == null) {
final PaymentDetail paymentDetail = null;
this.depositAccountDomainService.handleFDDeposit(account, fmt, account.getActivationLocalDate(),
amountForDeposit.getAmount(), paymentDetail);
} else {
final SavingsAccount fromSavingsAccount = null;
boolean isRegularTransaction = false;
final AccountTransferDTO accountTransferDTO = new AccountTransferDTO(account.getActivationLocalDate(),
amountForDeposit.getAmount(), PortfolioAccountType.SAVINGS, PortfolioAccountType.SAVINGS,
portfolioAccountData.accountId(), account.getId(), "Account Transfer", locale, fmt, null, null, null, null,
null, AccountTransferType.ACCOUNT_TRANSFER.getValue(), null, null, null, null, account, fromSavingsAccount,
isRegularTransaction);
this.accountTransfersWritePlatformService.transferFunds(accountTransferDTO);
}