-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
749edd7
commit 1f6b2d1
Showing
16 changed files
with
293 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
api/src/main/java/ca/bc/gov/educ/penreg/api/service/PenCoordinatorService.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
api/src/main/java/ca/bc/gov/educ/penreg/api/service/StudentRegistrationContactService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package ca.bc.gov.educ.penreg.api.service; | ||
|
||
import ca.bc.gov.educ.penreg.api.rest.RestUtils; | ||
import ca.bc.gov.educ.penreg.api.struct.SchoolContact; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.commons.lang3.StringUtils; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Service | ||
@Slf4j | ||
public class StudentRegistrationContactService { | ||
private final RestUtils restUtils; | ||
|
||
@Autowired | ||
public StudentRegistrationContactService(final RestUtils restUtils) { | ||
this.restUtils = restUtils; | ||
} | ||
|
||
public List<SchoolContact> getStudentRegistrationContactsByMincode(final String mincode) { | ||
if (StringUtils.length(mincode) != 8 || !StringUtils.isNumeric(mincode)) { | ||
return new ArrayList<>(); | ||
} | ||
|
||
return this.restUtils.getStudentRegistrationContactList(mincode); | ||
} | ||
|
||
public List<String> getStudentRegistrationContactEmailsByMincode(final String mincode) { | ||
log.debug("getting pen coordinator email for mincode :: {}", mincode); | ||
if (StringUtils.length(mincode) != 8 || !StringUtils.isNumeric(mincode)) { | ||
return new ArrayList<>(); | ||
} | ||
var contacts = this.restUtils.getStudentRegistrationContactList(mincode); | ||
return contacts.stream() | ||
.map(contact -> String.valueOf(contact.getEmail())) | ||
.toList(); | ||
} | ||
} |
Oops, something went wrong.