Class TicketBuying
java.lang.Object
passport.domain.contexts.purchases.TicketBuying
-
Constructor Summary
ConstructorDescriptionTicketBuying
(EmailService service, Events events, Users users, LocalDate currentDate) Constructor with specified email service.TicketBuying
(Events events, Users users, LocalDate currentDate) Constructor with default email service. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Executes the ticket purchase.Sets the customer who is buying the tickets.Sets the event for which tickets are being bought.via
(PaymentMethod paymentMethod) Sets the payment method for the purchase.
-
Constructor Details
-
TicketBuying
-
TicketBuying
Constructor with specified email service.- Parameters:
service
- the email serviceevents
- the events repositoryusers
- the users repositorycurrentDate
- the current date of the context
-
-
Method Details
-
of
Sets the event for which tickets are being bought.- Parameters:
event
- the event ID- Returns:
- the updated TicketBuying object
- Throws:
PurchaseForInactiveEvent
-
by
Sets the customer who is buying the tickets.- Parameters:
customer
- the user ID of the customer- Returns:
- the updated TicketBuying object
-
via
Sets the payment method for the purchase.- Parameters:
paymentMethod
- the payment method- Returns:
- the updated TicketBuying object
-
buy
-