private void verifyEmployee()

in service/src/main/java/org/apache/fineract/cn/teller/service/rest/TellerManagementRestController.java [320:330]


  private void verifyEmployee(final String employeeIdentifier) {
    final Optional<Teller> optionalTeller = this.tellerManagementService.findByAssignedEmployee(employeeIdentifier);
    if (optionalTeller.isPresent()) {
      throw ServiceException.conflict("Employee {0} already assigned to teller {1}.",
          employeeIdentifier, optionalTeller.get().getCode());
    }

    if (!this.organizationService.employeeExists(employeeIdentifier)) {
      throw ServiceException.badRequest("Employee {0} not found.", employeeIdentifier);
    }
  }