public void acknowledgeNotification()

in ddm-notification-service-inbox/src/main/java/com/epam/digital/data/platform/notification/inbox/service/InboxNotificationService.java [88:102]


  public void acknowledgeNotification(UUID notificationId, String accessToken) {
    Optional<InboxNotification> byId = inboxNotificationRepository.findById(notificationId);
    if (byId.isPresent()) {
      JwtClaims jwtClaims = tokenParserService.parseClaims(accessToken);

      InboxNotification inboxNotification = byId.get();
      if (!StringUtils.equals(jwtClaims.getSubject(), inboxNotification.getRecipientId())) {
        throw new ForbiddenNotificationActionException(
            "Forbidden. Notification state can't be updated.");
      }

      inboxNotification.setAcknowledged(true);
      inboxNotificationRepository.save(inboxNotification);
    }
  }