We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 27ceb22 commit b857dd4Copy full SHA for b857dd4
1 file changed
domain/src/main/java/br/com/ifsp/tickets/domain/administrative/ticket/Ticket.java
@@ -65,8 +65,7 @@ private boolean expire() {
65
}
66
67
public boolean isValidToConsume() {
68
- final LocalDateTime now = LocalDateTime.now();
69
- return now.toLocalDate().isEqual(this.validIn);
+ return LocalDate.now().isEqual(this.validIn);
70
71
72
public void cancel() {
@@ -106,7 +105,7 @@ public Optional<DomainException> consume(Event event) {
106
105
return Optional.of(exception);
107
108
109
- if (this.isValidToConsume()) {
+ if (!this.isValidToConsume()) {
110
final TicketConsumeException exception = new TicketConsumeException("Ticket is not valid yet");
111
this.registerEvent(new TicketConsumedError(this, exception.getMessage()));
112
0 commit comments