diff --git a/api/src/main/java/ca/bc/gov/educ/penreg/api/batch/processor/PenRegBatchProcessor.java b/api/src/main/java/ca/bc/gov/educ/penreg/api/batch/processor/PenRegBatchProcessor.java index ffde89c1..650ec4f0 100644 --- a/api/src/main/java/ca/bc/gov/educ/penreg/api/batch/processor/PenRegBatchProcessor.java +++ b/api/src/main/java/ca/bc/gov/educ/penreg/api/batch/processor/PenRegBatchProcessor.java @@ -253,7 +253,7 @@ private void processFileUnProcessableException(@NonNull final String guid, @NonN val notifySchoolForFileFormatErrorsOptional = this.notifySchoolForFileFormatErrors(guid, penWebBlobEntity, fileUnProcessableException); final PenRequestBatchEntity entity = mapper.toPenReqBatchEntityForBusinessException(penWebBlobEntity, fileUnProcessableException.getReason(), fileUnProcessableException.getPenRequestBatchStatusCode(), batchFile, persistStudentRecords(fileUnProcessableException.getFileError())); // batch file can be processed further and persisted. final Optional school = this.restUtils.getSchoolByMincode(penWebBlobEntity.getMincode()); - school.ifPresent(value -> entity.setSchoolName(value.getSchoolName())); + school.ifPresent(value -> entity.setSchoolName(value.getDisplayName())); //wait here if notification was sent, if there was any error this file will be picked up again as it wont be persisted. if (notifySchoolForFileFormatErrorsOptional.isPresent()) { final boolean isNotified = this.waitForNotificationToCompleteIfPresent(guid, notifySchoolForFileFormatErrorsOptional.get()); diff --git a/api/src/main/java/ca/bc/gov/educ/penreg/api/service/StudentRegistrationContactService.java b/api/src/main/java/ca/bc/gov/educ/penreg/api/service/StudentRegistrationContactService.java index 6ff9ce92..01deb71b 100644 --- a/api/src/main/java/ca/bc/gov/educ/penreg/api/service/StudentRegistrationContactService.java +++ b/api/src/main/java/ca/bc/gov/educ/penreg/api/service/StudentRegistrationContactService.java @@ -31,14 +31,14 @@ public List getStudentRegistrationContactsByMincode(final String return this.restUtils.getStudentRegistrationContactList(mincode); } - public String getStudentRegistrationContactEmailsByMincode(final String mincode) { + public List getStudentRegistrationContactEmailsByMincode(final String mincode) { log.debug("getting pen coordinator email for mincode :: {}", mincode); if (StringUtils.length(mincode) != 8 || !StringUtils.isNumeric(mincode)) { - return ""; + return new ArrayList<>(); } var contacts = this.restUtils.getStudentRegistrationContactList(mincode); return contacts.stream() .map(contact -> String.valueOf(contact.getEmail())) - .collect(Collectors.joining(",")); + .toList(); } }