Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Miensoap committed Jun 26, 2024
1 parent 055e210 commit 4a284dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion BE/src/main/java/team07/airbnb/entity/ProductEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public ProductEntity reopen(BookingEntity booking) {
}

public boolean isDateInRange(LocalDate start, LocalDate end) {
return this.date.isAfter(start) && this.date.isBefore(end.plusDays(1L));
return !this.date.isBefore(start) && this.date.isBefore(end.plusDays(1L));
}

private void checkBookingEquality(BookingEntity booking) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ private int getAveragePriceForDateRange(List<ProductEntity> openProducts, LocalD
.filter(product -> product.isDateInRange(checkInDate, checkInDate))
.toList();
}
log.info(openProducts.toString());
return (int) openProducts.stream()
.mapToInt(ProductEntity::getPrice)
.average()
Expand Down

0 comments on commit 4a284dd

Please sign in to comment.