Package passport.domain.contexts.events
Class EventRegistering
java.lang.Object
passport.domain.contexts.events.EventRegistering
-
Constructor Summary
ConstructorsConstructorDescriptionEventRegistering(Events repository) Constructor with the specified events repository. -
Method Summary
Modifier and TypeMethodDescriptionSets the author of the event.Sets the current day for the context.Sets the poster for the event.voidregister()Registers the event.
-
Constructor Details
-
EventRegistering
Constructor with the specified events repository.- Parameters:
repository- the repository of events used for registering
-
-
Method Details
-
poster
Sets the poster for the event.- Parameters:
poster- the event poster- Returns:
- the updated EventRegistering object
-
by
Sets the author of the event.- Parameters:
author- the author of the event- Returns:
- the updated EventRegistering object
- Throws:
PermissionDenied- if the author is not an admin
-
on
Sets the current day for the context.- Parameters:
currentDay- the current day- Returns:
- the updated EventRegistering object
-
register
Registers the event.- Throws:
EventAlreadyRegistered- if the event is already registeredCantRegisterPastEvent- if the event is scheduled for a past date
-