in ddm-notification-service-inbox/src/main/java/com/epam/digital/data/platform/notification/inbox/service/InboxNotificationService.java [50:67]
public void notify(InboxNotificationMessageDto message) {
log.info("Sending inbox notification - saving in database");
log.info("Getting user id by username");
var idmService = idmServiceProvider.getIdmService(message.getRecipientRealm());
var users = idmService.getUserByUserName(message.getRecipientName());
if (users.isEmpty()) {
throw new IllegalArgumentException("User not found by username");
}
inboxNotificationRepository.save(
InboxNotification.builder()
.subject(message.getNotification().getSubject())
.message(message.getNotification().getMessage())
.recipientId(users.get(0).getId())
.build());
log.info("Inbox notification was sent - saved in database");
}