public String process()

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


  public String process(final CreateTellerCommand createTellerCommand) {
    final String officeIdentifier = createTellerCommand.officeIdentifier();
    final Teller teller = createTellerCommand.teller();

    if (this.checkPreconditions(officeIdentifier, teller)) {

      final TellerEntity tellerEntity = TellerMapper.map(officeIdentifier, teller);

      this.encryptPassword(teller, tellerEntity);

      tellerEntity.setState(Teller.State.CLOSED.name());
      tellerEntity.setCreatedBy(UserContextHolder.checkedGetUser());
      tellerEntity.setCreatedOn(LocalDateTime.now(Clock.systemUTC()));

      this.tellerRepository.save(tellerEntity);

      this.organizationService.setTellerReference(officeIdentifier);

      return teller.getCode();
    } else {
      throw new IllegalStateException("Preconditions not met, see log file for further information.");
    }
  }