Class UserMutationController
java.lang.Object
it.univr.passportease.controller.user.UserMutationController
Controller for all the user mutations. It handles the following GraphQL mutations:
 
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate BucketLimiterBucket limiter.private final JwtServiceRequest analyzer.private RequestAnalyzerRequest analyzer.private final UserMutationServiceUser mutation service.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncreateNotification(NotificationInput notificationInput) This mutation creates a notification.createReservation(String availabilityID) This mutation creates a reservation from an availability.voiddeleteNotification(UUID notificationId) This mutation deletes a notification.voiddeleteReservation(String availabilityID) This mutation deletes a reservation.modifyNotification(NotificationInput notificationInput, UUID notificationId) This mutation modifies a notification.voidpreserveAvailability(String availabilityID) 
- 
Field Details- 
userMutationServiceUser mutation service.
- 
jwtServiceRequest analyzer.
- 
bucketLimiterBucket limiter.
- 
requestAnalyzerRequest analyzer.
 
- 
- 
Constructor Details- 
UserMutationControllerpublic UserMutationController()
 
- 
- 
Method Details- 
createReservation@MutationMapping public Availability createReservation(@Argument("availabilityID") String availabilityID) throws RateLimitException, AvailabilityNotFoundException, UserNotFoundException, InvalidAvailabilityIDException This mutation creates a reservation from an availability. It returns the created reservation.- Parameters:
- availabilityID- the availability ID to create the reservation from.
- Returns:
- the created reservation
- Throws:
- RateLimitException- if the user has exceeded the rate limit
- AvailabilityNotFoundException- if the availability is not found
- UserNotFoundException- if the user is not found
- InvalidAvailabilityIDException- 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@MutationMapping public void deleteReservation(@Argument("availabilityID") String availabilityID) throws RateLimitException, AvailabilityNotFoundException This mutation deletes a reservation. It returns nothing.- Parameters:
- availabilityID- the availability ID to delete.
- Throws:
- RateLimitException- if the user has exceeded the rate limit
- AvailabilityNotFoundException- if the availability is not found
 
- 
createNotification@MutationMapping public Notification createNotification(@Argument("notification") NotificationInput notificationInput) throws UserNotFoundException, InvalidWorkerActionException, AuthenticationCredentialsNotFoundException, RateLimitException, InvalidRequestTypeException, OfficeNotFoundException This mutation creates a notification. It returns the created notification.- Parameters:
- notificationInput- see- NotificationInput, the notification to create
- Returns:
- the created notification
- Throws:
- UserNotFoundException- if the user is not found
- InvalidWorkerActionException- if the user is a worker
- AuthenticationCredentialsNotFoundException- if the token is not in the request
- RateLimitException- if the user has exceeded the rate limit
- InvalidRequestTypeException- if the request type is invalid
- OfficeNotFoundException- if the office is not found
 
- 
modifyNotification@MutationMapping public Notification modifyNotification(@Argument("notification") NotificationInput notificationInput, @Argument("notificationID") UUID notificationId) throws RateLimitException, NotificationNotFoundException, OfficeNotFoundException, RequestTypeNotFoundException This mutation modifies a notification. It returns the modified notification.- Parameters:
- notificationInput- see- NotificationInput, the notification to modify
- notificationId- the notification ID to modify
- Returns:
- the modified notification
- Throws:
- RateLimitException- if the user has exceeded the rate limit
- NotificationNotFoundException- if the notification is not found
- OfficeNotFoundException- if the office is not found
- RequestTypeNotFoundException- if the request type is not found
 
- 
deleteNotification@MutationMapping public void deleteNotification(@Argument("notificationID") UUID notificationId) throws RateLimitException This mutation deletes a notification. It returns nothing.- Parameters:
- notificationId- the notification ID to delete
- Throws:
- RateLimitException- if the user has exceeded the rate limit
 
- 
preserveAvailability@MutationMapping public void preserveAvailability(@Argument("availabilityID") String availabilityID) throws RateLimitException, AvailabilityNotFoundException 
 
-