Skip to content

Commit

Permalink
[DUOS-2758] Index DAC email and retire top-level DAC name (#2186)
Browse files Browse the repository at this point in the history
  • Loading branch information
fboulnois committed Nov 14, 2023
1 parent e29f977 commit 2a244ea
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package org.broadinstitute.consent.http.models.elastic_search;

public record DacTerm (Integer dacId, String dacName) {}
public record DacTerm(Integer dacId, String dacName, String dacEmail) {

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public class DatasetTerm {
private String dataLocation;
private String url;
private Integer dacId;
@Deprecated // Use dac.name instead
private String dacName;
private Boolean dacApproval;
private String accessManagement;
private List<Integer> approvedUserIds;
Expand Down Expand Up @@ -106,14 +104,6 @@ public void setDacId(Integer dacId) {
this.dacId = dacId;
}

public String getDacName() {
return dacName;
}

public void setDacName(String dacName) {
this.dacName = dacName;
}

public Boolean getDacApproval() {
return dacApproval;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public DacTerm toDacTerm(Dac dac) {
if (Objects.isNull(dac)) {
return null;
}
return new DacTerm(dac.getDacId(), dac.getName());
return new DacTerm(dac.getDacId(), dac.getName(), dac.getEmail());
}

public InstitutionTerm toInstitutionTerm(Institution institution) {
Expand Down Expand Up @@ -263,7 +263,6 @@ public DatasetTerm toDatasetTerm(Dataset dataset) {
Optional.ofNullable(dataset.getDacId()).ifPresent(dacId -> {
Dac dac = dacDAO.findById(dataset.getDacId());
term.setDacId(dataset.getDacId());
term.setDacName(dac.getName());
if (Objects.nonNull(dataset.getDacApproval())) {
term.setDacApproval(dataset.getDacApproval());
}
Expand Down

0 comments on commit 2a244ea

Please sign in to comment.