Skip to content

Commit

Permalink
Merge pull request #1092 from eclipse-tractusx/feature/962-notificati…
Browse files Browse the repository at this point in the history
…on-model-update

feature(chore):962 fixed sonar issues.
  • Loading branch information
ds-mmaul authored Jun 21, 2024
2 parents d1d2ccb + 04715a0 commit 4e79a8c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public static Notification toDomain(NotificationEntity notificationEntity) {
List<String> assetIds = notificationEntity.getAssets().stream()
.map(AssetAsBuiltEntity::getId)
.toList();
String initialReceiverBpn = notificationEntity.getInitialReceiverBpn();
if (initialReceiverBpn == null){
initialReceiverBpn = notificationEntity.getBpn();
}
return Notification.builder()
.title(notificationEntity.getTitle())
.notificationId(new NotificationId(notificationEntity.getId()))
Expand All @@ -90,11 +94,11 @@ public static Notification toDomain(NotificationEntity notificationEntity) {
.description(notificationEntity.getDescription())
.notificationType(NotificationType.valueOf(notificationEntity.getType().name()))
.affectedPartIds(assetIds)
.sendTo(notificationEntity.getInitialReceiverBpn())
.sendTo(initialReceiverBpn)
.targetDate(convertInstantToString(notificationEntity.getTargetDate()))
.severity(NotificationSeverity.fromString(notificationEntity.getSeverity() != null ? notificationEntity.getSeverity().getRealName() : null))
.notifications(messages)
.initialReceiverBpns(List.of(notificationEntity.getInitialReceiverBpn()))
.initialReceiverBpns(List.of())
.build();
}

Expand Down

0 comments on commit 4e79a8c

Please sign in to comment.