public String process()

in service/src/main/java/org/apache/fineract/cn/teller/service/internal/command/handler/TellerAggregate.java [293:309]


  public String process(final DeleteTellerCommand deleteTellerCommand) {
    final String tellerCode = deleteTellerCommand.tellerCode();

    final Optional<TellerEntity> optionalTeller = this.tellerRepository.findByIdentifier(tellerCode);
    if (optionalTeller.isPresent()) {
      final TellerEntity tellerEntity = optionalTeller.get();
      if (tellerEntity.getLastOpenedBy() == null) {
        this.tellerRepository.delete(tellerEntity);
        return tellerCode;
      } else {
        this.logger.warn("Could not close teller {}, already used.", tellerCode);
      }
    } else {
      this.logger.warn("Teller {} not found.", tellerCode);
    }
    return null;
  }