@@ -31,7 +31,7 @@ public void updateStatusToNotCancelable() {
31
31
List <Reservation > reservations = reservationRepository .findByCheckin (targetTime );
32
32
33
33
reservations .stream ()
34
- .filter (reservation -> reservation .getStatus () != ReservationStatus .NOTCANCELABLE )
34
+ .filter (reservation -> reservation .getStatus () != ReservationStatus .RESERVED )
35
35
.forEach (reservation -> reservation .changeStatus (ReservationStatus .NOTCANCELABLE ));
36
36
37
37
reservationRepository .saveAll (reservations );
@@ -43,14 +43,14 @@ public void updateStatusToNotCancelable() {
43
43
@ Scheduled (cron = "0 0 15 * * ?" )
44
44
public void updateStatusToCompleted () {
45
45
LocalDateTime now = LocalDateTime .now (ZoneId .of ("Asia/Seoul" ));
46
- LocalDateTime targetDate = now .toLocalDate ().atTime (15 , 0 );
47
-
48
- List <Reservation > reservations = reservationRepository .findByCheckin (targetDate );
49
- for ( Reservation reservation : reservations ) {
50
- if ( reservation . getStatus () != ReservationStatus . COMPLETED ) {
51
- reservation . changeStatus ( ReservationStatus .COMPLETED );
52
- }
53
- }
46
+ LocalDateTime targetTime = now .toLocalDate ().atTime (15 , 0 );
47
+
48
+ List <Reservation > reservations = reservationRepository .findByCheckin (targetTime );
49
+
50
+ reservations . stream ()
51
+ . filter ( reservation -> reservation . getStatus () == ReservationStatus .RESERVED )
52
+ . forEach ( reservation -> reservation . changeStatus ( ReservationStatus . COMPLETED ));
53
+
54
54
reservationRepository .saveAll (reservations );
55
55
56
56
log .debug ("체크인완료 업데이트 스케줄러가 실행되었습니다." );
0 commit comments