Skip to content
Snippets Groups Projects

OZG-7773 setHasNewPostfachNachricht only if there are incoming mails

Merged Krzysztof Witukiewicz requested to merge OZG-7773-set-relation-if-incoming-mails into main
1 file
+ 5
5
Compare changes
  • Side-by-side
  • Inline
@@ -116,10 +116,10 @@ class PostfachMailModelAssembler implements RepresentationModelAssembler<Postfac
return postfachMails.stream().anyMatch(IS_INCOMING);
}
void addPostfachNachrichtLinks(RepresentationModel<EntityModel<PostfachSettings>> model, VorgangMailInfo vorgangInfo) {
var vorgangId = vorgangInfo.vorgang.getId();
void addPostfachNachrichtLinks(RepresentationModel<EntityModel<PostfachSettings>> model, VorgangMailInfo vorgangMailInfo) {
var vorgangId = vorgangMailInfo.vorgang.getId();
if (vorgangController.isEditable(vorgangInfo.vorgang)) {
if (vorgangController.isEditable(vorgangMailInfo.vorgang)) {
model.add(linkTo(methodOn(PostfachMailCommandByVorgangController.class).sendPostfachMail(vorgangId, null))
.withRel(REL_SEND_POSTFACH_MAIL));
}
@@ -127,9 +127,9 @@ class PostfachMailModelAssembler implements RepresentationModelAssembler<Postfac
model.add(linkTo(BinaryFileController.class).slash(vorgangId).slash(POSTFACH_NACHRICHT_ATTACHMENT_FIELD).slash(FILE_PATH)
.withRel(REL_UPLOAD_ATTACHMENT));
if (vorgangInfo.vorgang.isHasNewPostfachNachricht()) {
if (vorgangMailInfo.vorgang.isHasNewPostfachNachricht()) {
model.add(linkTo(VorgangController.class).slash(vorgangId).slash(HAS_NEW_POSTFACH_NACHRICHT_FIELD).withRel(REL_RESET_NEW_POSTFACH_MAIL));
} else if (vorgangInfo.hasIncomingMails()) {
} else if (vorgangMailInfo.hasIncomingMails()) {
model.add(linkTo(VorgangController.class).slash(vorgangId).slash(HAS_NEW_POSTFACH_NACHRICHT_FIELD).withRel(REL_SET_HAS_NEW_POSTFACH_MAIL));
}
}
Loading