@Transactional
  @Override
  public EntityIdentifier withdrawDepositAccountMoney(
      final DepositAccountWithdrawalCommand command) {

    context.authenticatedUser();

    DepositAccountWithdrawalCommandValidator validator =
        new DepositAccountWithdrawalCommandValidator(command);
    validator.validate();

    DepositAccount account = this.depositAccountRepository.findOne(command.getAccountId());
    if (account == null || account.isDeleted()) {
      throw new DepositAccountNotFoundException(command.getAccountId());
    }

    LocalDate eventDate = command.getMaturesOnDate();

    Integer lockinPeriod = account.getLockinPeriod();
    LocalDate lockinPeriodExpDate =
        account.getActualCommencementDate().plusMonths(Integer.valueOf(lockinPeriod));
    if (account.isLockinPeriodAllowed()) {
      if (eventDate.isBefore(lockinPeriodExpDate)) {
        throw new DepositAccountTransactionsException(
            "deposit.transaction.canot.withdraw.before.lockinperiod.reached",
            "You can not withdraw your application before maturity date reached");
      }
    }
    // if (eventDate.isBefore(account.maturesOnDate())) {
    // this.depositAccountAssembler.adjustTotalAmountForPreclosureInterest(account,
    // eventDate);
    // }
    account.withdrawDepositAccountMoney(
        defaultDepositLifecycleStateMachine(), fixedTermDepositInterestCalculator, eventDate);
    this.depositAccountRepository.save(account);
    String noteText = command.getNote();
    if (StringUtils.isNotBlank(noteText)) {
      Note note = Note.depositNote(account, noteText);
      this.noteRepository.save(note);
    }

    return new EntityIdentifier(account.getId());
  }