Package com.dzidzi.api
Interface NotificationApi
public interface NotificationApi
-
Method Summary
Modifier and TypeMethodDescriptionfindPaginatedNotifications(FindNotificationRequest findNotificationRequest) The paged results of the provided request.getNotification(UUID notificationId) Gets notification by given id.getNotificationsByRecipientId(UUID recipientId) Gets all notifications by the given recipient id.getNotificationsByRecipientIdAndStatus(UUID recipientId, NotificationStatus status) Gets all notifications by the given recipient id and the statusreadNotification(UUID notificationId) Gets notification by given id.voidremoveNotification(UUID notificationId) Removes notification by the given id.
-
Method Details
-
getNotification
Gets notification by given id.- Parameters:
notificationId- the notification id- Returns:
- the
Notification - Throws:
com.dzidzi.exception.EntityNotFoundException- when notification is not found
-
readNotification
Gets notification by given id. This changes the status toNotificationStatus.READif it is unread.- Parameters:
notificationId- the notification id- Returns:
- the
Notification - Throws:
com.dzidzi.exception.EntityNotFoundException- when notification is not found
-
getNotificationsByRecipientId
Gets all notifications by the given recipient id.- Parameters:
recipientId- the recipient id. This can be admin id, courier id, restaurant id, service id or user id.- Returns:
- list of notifications
-
getNotificationsByRecipientIdAndStatus
List<Notification> getNotificationsByRecipientIdAndStatus(UUID recipientId, NotificationStatus status) Gets all notifications by the given recipient id and the status- Parameters:
recipientId- the recipient id. This can be admin id, courier id, restaurant id, service id or user id.status- theNotificationStatus- Returns:
- list of notifications
-
getAllNotifications
List<Notification> getAllNotifications() -
findPaginatedNotifications
DzidziPaginationDTO<Notification> findPaginatedNotifications(FindNotificationRequest findNotificationRequest) The paged results of the provided request.- Parameters:
findNotificationRequest- the requests used for filtering notifications- Returns:
- the
DzidziPaginationDTO
-
removeNotification
Removes notification by the given id.- Parameters:
notificationId- the notification id
-