Skip to content
Snippets Groups Projects

Replace NetID with Email in Exports + Change Separator to Comma for valid CSV

4 files
+ 39
10
Compare changes
  • Side-by-side
  • Inline

Files

@@ -414,12 +414,12 @@ public class ApplicationService {
@@ -414,12 +414,12 @@ public class ApplicationService {
public Path exportApplications(String name, List<Application> applications) throws IOException {
public Path exportApplications(String name, List<Application> applications) throws IOException {
personCache.get(applications.stream().map(a -> a.getId().getPersonId()));
personCache.get(applications.stream().map(a -> a.getId().getPersonId()));
String[] headers = new String[] { "Student number", "NetID", "Name", "Edition", "Job Offer",
String[] headers = new String[] { "Student Number", "Email", "Name", "Edition", "Job Offer",
"Status" };
"Status" };
Stream<String[]> data = applications.stream().map(app -> {
Stream<String[]> data = applications.stream().map(app -> {
PersonSummaryDTO applicant = personCache.getOrThrow(app.getId().getPersonId());
PersonSummaryDTO applicant = personCache.getOrThrow(app.getId().getPersonId());
EditionDetailsDTO edition = editionCache.getOrThrow(app.getJobOffer().getEditionId());
EditionDetailsDTO edition = editionCache.getOrThrow(app.getJobOffer().getEditionId());
return new String[] { applicant.getNumber().toString(), applicant.getUsername(),
return new String[] { applicant.getNumber().toString(), applicant.getEmail(),
applicant.getDisplayName(), edition.getCourse().getName() + " - " + edition.getName(),
applicant.getDisplayName(), edition.getCourse().getName() + " - " + edition.getName(),
app.getJobOffer().getName(), app.getStatus().toString() };
app.getJobOffer().getName(), app.getStatus().toString() };
});
});
Loading