Skip to content

Commit

Permalink
Format the code
Browse files Browse the repository at this point in the history
  • Loading branch information
VasylyshynDmytro committed Dec 2, 2024
1 parent bcdd6d1 commit 16b6cbf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,5 @@ public class ErrorMessage {
public static final String INVITATION_NOT_FOUND = "Invitation not found";
public static final String YOU_HAS_ALREADY_ACCEPT_THIS_INVITATION = "Current user already has accepted invitation";
public static final String INVITATION_ALREADY_EXIST = "Invitation already exist";
public static final String INVALID_DURATION_BETWEEN_START_AND_FINISH = "Invalid duration between start and finish"
;
public static final String INVALID_DURATION_BETWEEN_START_AND_FINISH = "Invalid duration between start and finish";
}
15 changes: 7 additions & 8 deletions service/src/main/java/greencity/service/EventServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -927,14 +927,13 @@ private List<EventDto> mapTupleListToEventDtoList(List<Tuple> page, List<Long> s
private void checkingEqualityDateTimeInEventDateLocationDto(List<EventDateLocationDto> eventDateLocationDtos) {
if (eventDateLocationDtos != null && !eventDateLocationDtos.isEmpty()) {
eventDateLocationDtos.stream()
.filter(eventDateLocationDto -> Duration.between(
eventDateLocationDto.getStartDate(),
eventDateLocationDto.getFinishDate()
).toMinutes() < 30)
.findAny()
.ifPresent(eventDateLocationDto -> {
throw new IllegalArgumentException(ErrorMessage.INVALID_DURATION_BETWEEN_START_AND_FINISH);
});
.filter(eventDateLocationDto -> Duration.between(
eventDateLocationDto.getStartDate(),
eventDateLocationDto.getFinishDate()).toMinutes() < 30)
.findAny()
.ifPresent(eventDateLocationDto -> {
throw new IllegalArgumentException(ErrorMessage.INVALID_DURATION_BETWEEN_START_AND_FINISH);
});
}

}
Expand Down

0 comments on commit 16b6cbf

Please sign in to comment.