Skip to content

Commit

Permalink
fix: reservation date 중복 처리 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
daeun084 committed Feb 19, 2024
1 parent f8f25c7 commit 192d79b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ public ReservationCompleteDto createReservation(ReservationRequestDto reservatio
//예약 중복 처리
List<Reservation> reservationList = reservationRepository.findByModelAndPortfolio(model, portfolio);
for(int i=0; i<reservationList.size(); i++){
if(reservationList.get(i).getReservationDayOfWeekAndTime().equals(reservationDto.getReservationDayOfWeekAndTime())){
Reservation reservation = reservationList.get(i);
if(reservation.getReservationDayOfWeekAndTime().equals(reservationDto.getReservationDayOfWeekAndTime())
&& reservation.getReservationDate().equals(reservationDto.getReservationDate())){
throw new GlobalException(ErrorStatus.NOT_ALLOW_DUPLICATED_RESERVATION);
}
}
Expand Down

0 comments on commit 192d79b

Please sign in to comment.