Package passport.domain.models.events
Class BoxOffice
java.lang.Object
passport.domain.models.events.BoxOffice
Represents a box office for selling and refunding event tickets.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the number of available tickets.capacity()
Returns the capacity of the event.boolean
Checks if the event is sold out.ofCapacity
(Integer amount) Creates a BoxOffice with the specified capacity.void
Refunds the specified ticket.sales()
Returns the number of tickets sold.void
Sells the specified ticket.ticket()
Creates a ticket with the specified amount of available seats.
-
Constructor Details
-
BoxOffice
Constructs a new BoxOffice with the specified ticket sample and default capacity and sales.- Parameters:
ticket
- the sample ticket
-
BoxOffice
-
-
Method Details
-
ofCapacity
-
ticket
-
ticket
-
sell
-
refund
Refunds the specified ticket.- Parameters:
ticket
- the ticket to refund
-
available
Returns the number of available tickets.- Returns:
- the number of available tickets
-
isSoldOut
public boolean isSoldOut()Checks if the event is sold out.- Returns:
- true if the event is sold out, false otherwise
-
sales
-
capacity
-