public String process()

in service/src/main/java/org/apache/fineract/cn/teller/service/internal/command/handler/TellerTransactionAggregate.java [114:140]


  public String process(final ConfirmTellerTransactionCommand confirmTellerTransactionCommand) {
    final Optional<TellerTransactionEntity> optionalTellerTransaction =
        this.tellerTransactionRepository.findByIdentifier(confirmTellerTransactionCommand.tellerTransactionIdentifier());

    if (optionalTellerTransaction.isPresent()) {
      final TellerTransactionEntity tellerTransactionEntity = optionalTellerTransaction.get();
      final TellerTransaction tellerTransaction = TellerTransactionMapper.map(tellerTransactionEntity);

      if (tellerTransactionEntity.getTransactionType().equals(ServiceConstants.TX_CHEQUE)) {
        final Optional<ChequeEntity> optionalCheque =
            this.chequeRepository.findByTellerTransactionId(tellerTransactionEntity.getId());

        optionalCheque.ifPresent(chequeEntity -> tellerTransaction.setCheque(ChequeMapper.map(chequeEntity)));
      }

      this.tellerTransactionProcessor.process(tellerTransactionEntity.getTeller().getIdentifier(),
          tellerTransaction, confirmTellerTransactionCommand.chargesIncluded());

      tellerTransactionEntity.setState(TellerTransaction.State.CONFIRMED.name());
      this.tellerTransactionRepository.save(tellerTransactionEntity);

      return confirmTellerTransactionCommand.tellerTransactionIdentifier();
    } else {
      this.logger.warn("Teller transaction {} not found", confirmTellerTransactionCommand.tellerTransactionIdentifier());
    }
    return null;
  }