Skip to content

Commit

Permalink
Allow rating scheme items to mandate comments
Browse files Browse the repository at this point in the history
- updated model and dao

#CTCTOWALTZ-2827
finos#6708
  • Loading branch information
db-waltz committed Jan 17, 2024
1 parent 3dc030c commit a92d8b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public class RatingSchemeDAO {

RatingSchemeItemRecord r = record.into(RATING_SCHEME_ITEM);

ImmutableRatingSchemeItem.Builder builder = ImmutableRatingSchemeItem.builder()
ImmutableRatingSchemeItem.Builder builder = ImmutableRatingSchemeItem
.builder()
.id(r.getId())
.ratingSchemeId(r.getSchemeId())
.name(r.getName())
Expand All @@ -81,7 +82,8 @@ public class RatingSchemeDAO {
.position(r.getPosition())
.description(r.getDescription())
.externalId(ofNullable(r.getExternalId()))
.ratingGroup(r.getRatingGroup());
.ratingGroup(r.getRatingGroup())
.requiresComment(r.getRequiresComment());


if (record.field(IS_RESTRICTED_FIELD) != null){
Expand Down Expand Up @@ -237,6 +239,7 @@ public Long saveRatingItem(long schemeId,
r.setPosition(item.position());
r.setUserSelectable(item.userSelectable());
r.setRatingGroup(item.ratingGroup());
r.setRequiresComment(item.requiresComment());

item.externalId().ifPresent(r::setExternalId);

Expand Down Expand Up @@ -324,5 +327,4 @@ public List<RatingSchemeItemUsageCount> calcRatingUsageStats() {
.build());
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,9 @@ public boolean userSelectable() {
@Nullable
public abstract String ratingGroup();

@Value.Default
public boolean requiresComment() {
return false;
}

}

0 comments on commit a92d8b7

Please sign in to comment.