Skip to content

Commit

Permalink
fix: ticket consume
Browse files Browse the repository at this point in the history
  • Loading branch information
oproprioleonardo committed Oct 26, 2024
1 parent d34db8c commit 58fe044
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import br.com.ifsp.tickets.domain.shared.exceptions.TicketConsumeException;
import br.com.ifsp.tickets.domain.shared.exceptions.TicketExpiredException;
import br.com.ifsp.tickets.domain.shared.validation.IValidationHandler;
import br.com.ifsp.tickets.domain.ticket.payment.PaymentStatus;
import br.com.ifsp.tickets.domain.ticket.vo.TicketCode;
import br.com.ifsp.tickets.domain.user.UserID;
import lombok.Getter;
Expand Down Expand Up @@ -94,7 +93,7 @@ public void cancel() {
public void consume(Event event) {
if (!event.getStatus().isOpened() && !event.getStatus().isInProgress())
throw new TicketConsumeException("Event is not open and is not in progress");
if (!event.getId().equals(this.ticketSaleID))
if (!event.getId().equals(this.eventID))
throw new TicketConsumeException("Ticket does not belong to this event");
if (this.status.isCanceled())
throw new TicketConsumeException("Ticket is canceled");
Expand Down

0 comments on commit 58fe044

Please sign in to comment.