Skip to content

Commit

Permalink
Merge pull request #6851 from ORCID/8798-qasummary-page-rename-variab…
Browse files Browse the repository at this point in the history
…le-validatedorselfasserted-to-validated

fix: Rename variables in summary endpoint
  • Loading branch information
amontenegro authored Aug 7, 2023
2 parents a267a46 + a00785b commit 341807c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class AffiliationSummary {
public String endDate;
public String role;
public String type;
public boolean validatedOrSelfAsserted;
public boolean validated;

public String getOrganizationName() {
return organizationName;
Expand Down Expand Up @@ -64,12 +64,12 @@ public void setType(String type) {
this.type = type;
}

public boolean isValidatedOrSelfAsserted() {
return validatedOrSelfAsserted;
public boolean isValidated() {
return validated;
}

public void setValidatedOrSelfAsserted(boolean validatedOrSelfAsserted) {
this.validatedOrSelfAsserted = validatedOrSelfAsserted;
public void setValidated(boolean validated) {
this.validated = validated;
}

public static List<AffiliationSummary> valueOf(List<org.orcid.jaxb.model.v3.release.record.summary.AffiliationSummary> affiliationGroupForms, String orcid, String type) {
Expand Down Expand Up @@ -109,7 +109,7 @@ public static AffiliationSummary valueOf(org.orcid.jaxb.model.v3.release.record.
form.setType(type);

if (as.getSource() != null) {
form.setValidatedOrSelfAsserted(SourceUtils.isSelfAsserted(as.getSource(), orcid));
form.setValidated(SourceUtils.isSelfAsserted(as.getSource(), orcid));
}
}
return form;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class RecordSummary {
private String lastModified;
private int validatedWorks;
private int selfAssertedWorks;
private int reviews;
private int peerReviewsTotal;
private int peerReviewPublicationGrants;
private int validatedFunds;
private int selfAssertedFunds;
Expand Down Expand Up @@ -85,12 +85,12 @@ public void setSelfAssertedWorks(int selfAssertedWorks) {
this.selfAssertedWorks = selfAssertedWorks;
}

public int getReviews() {
return reviews;
public int getPeerReviewsTotal() {
return peerReviewsTotal;
}

public void setReviews(int reviews) {
this.reviews = reviews;
public void setPeerReviewsTotal(int peerReviewsTotal) {
this.peerReviewsTotal = peerReviewsTotal;
}

public int getPeerReviewPublicationGrants() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ RecordSummary getSummary(String orcid) {
Record record = recordManagerReadOnly.getPublicRecord(orcid, false);
Person person = record.getPerson();
if (person != null) {
String displayName = "Name is private or limited";
String displayName = "undefined";
Name name = person.getName();
if (name != null) {
if (name.getVisibility().equals(org.orcid.jaxb.model.v3.release.common.Visibility.PUBLIC)) {
Expand Down Expand Up @@ -466,10 +466,10 @@ RecordSummary getSummary(String orcid) {
peerReviewMinimizedSummaryList.forEach(peerReviewMinimizedSummary -> {
publicationGrants.set(publicationGrants.intValue() + peerReviewMinimizedSummary.getPutCodes().size());
});
recordSummary.setReviews(peerReviewMinimizedSummaryList.size());
recordSummary.setPeerReviewsTotal(peerReviewMinimizedSummaryList.size());
recordSummary.setPeerReviewPublicationGrants(publicationGrants.intValue());
} else {
recordSummary.setReviews(0);
recordSummary.setPeerReviewsTotal(0);
recordSummary.setPeerReviewPublicationGrants(0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void testGetRecordSummary() {
assertEquals(1, record.getValidatedWorks());
assertEquals(0, record.getSelfAssertedWorks());

assertEquals(0, record.getReviews());
assertEquals(0, record.getPeerReviewsTotal());
assertEquals(0, record.getPeerReviewPublicationGrants());

assertEquals(1, record.getValidatedFunds());
Expand Down

0 comments on commit 341807c

Please sign in to comment.