Interface UserMutationService
- All Known Implementing Classes:
UserMutationServiceImpl
public interface UserMutationService
Service that handles the mutation of the user entity.
-
Method Summary
Modifier and TypeMethodDescriptioncreateNotification
(NotificationInput notificationInput, User user) Creates a new notification.createReservation
(UUID availabilityId, User user) Creates a new availability.void
deleteNotification
(UUID notificationId) Deletes a notification.void
deleteReservation
(UUID availabilityId) Deletes an availability.modifyNotification
(NotificationInput notificationInput, UUID notificationId) Modifies a notification.void
preserveAvailability
(UUID availabilityId) Preserves the availability.
-
Method Details
-
createNotification
Notification createNotification(NotificationInput notificationInput, User user) throws OfficeNotFoundException, InvalidRequestTypeException Creates a new notification.- Parameters:
notificationInput
- the notification to be createduser
- the user that creates the notification- Returns:
- the created notification
- Throws:
OfficeNotFoundException
- if the office specified in the notification does not existInvalidRequestTypeException
- if the request type specified in the notification is invalid
-
deleteNotification
Deletes a notification.- Parameters:
notificationId
- the id of the notification to be deleted
-
modifyNotification
Notification modifyNotification(NotificationInput notificationInput, UUID notificationId) throws NotificationNotFoundException, OfficeNotFoundException, RequestTypeNotFoundException Modifies a notification.- Parameters:
notificationInput
- the new notification datanotificationId
- the id of the notification to be modified- Returns:
- the modified notification
- Throws:
NotificationNotFoundException
- if the notification to be modified does not existOfficeNotFoundException
- if the office specified in the notification does not existRequestTypeNotFoundException
- if the request type specified in the notification does not exist
-
createReservation
Availability createReservation(UUID availabilityId, User user) throws AvailabilityNotFoundException, UserNotFoundException, InvalidAvailabilityIDException Creates a new availability.- Parameters:
availabilityId
- the id of the availability to be createduser
- the user that creates the availability- Returns:
- the created availability
- Throws:
AvailabilityNotFoundException
- if the availability to be created does not existUserNotFoundException
- if the user that creates the availability does not existInvalidAvailabilityIDException
- if the availability 'ritiro passaporto' date is not valid, or if the availability is already taken. It must be at least one month after the last rilascio passaporto
-
deleteReservation
Deletes an availability.- Parameters:
availabilityId
- the id of the availability to be deleted- Throws:
AvailabilityNotFoundException
- if the availability to be deleted does not exist
-
preserveAvailability
Preserves the availability.- Parameters:
availabilityId
- the id of the availability to be preserved- Throws:
AvailabilityNotFoundException
- if the availability to be deleted does not exist
-