Skip to content

Commit 18887a3

Browse files
committed
Merge remote-tracking branch 'origin/dev' into dev
2 parents fe0baa5 + baaad4e commit 18887a3

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/main/java/com/github/classpick/reservation/service/ReservationAdminService.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
package com.github.classpick.reservation.service;
22

3-
import com.github.classpick.reservation.controller.dto.response.*;
3+
import com.github.classpick.reservation.controller.dto.response.NoshowListResponse;
4+
import com.github.classpick.reservation.controller.dto.response.NoshowResponse;
5+
import com.github.classpick.reservation.controller.dto.response.UserReservationListResponse;
6+
import com.github.classpick.reservation.controller.dto.response.UserReservationResponse;
47
import com.github.classpick.reservation.exception.ReservationException;
58
import com.github.classpick.reservation.exception.ReservationExceptionCode;
6-
import com.github.classpick.reservation.repository.*;
9+
import com.github.classpick.reservation.repository.NoshowEntity;
10+
import com.github.classpick.reservation.repository.NoshowRepository;
11+
import com.github.classpick.reservation.repository.ReservationEntity;
12+
import com.github.classpick.reservation.repository.ReservationRepository;
13+
import com.github.classpick.reservation.repository.Status;
714
import lombok.RequiredArgsConstructor;
815
import org.springframework.stereotype.Service;
916
import org.springframework.transaction.annotation.Transactional;
@@ -22,7 +29,12 @@ public UserReservationListResponse getUserReservationsList() {
2229

2330
List<UserReservationResponse> userReservationResponses = reservationRepository.findAll()
2431
.stream()
25-
.map(UserReservationResponse::from)
32+
.map(reservationEntity -> {
33+
NoshowEntity noshowEntity = noshowRepository.findByVerifiedNoshow(reservationEntity)
34+
.orElse(NoshowEntity.of(null, false, null));
35+
36+
return UserReservationResponse.from(reservationEntity, noshowEntity.isVerified());
37+
})
2638
.toList();
2739

2840
return UserReservationListResponse.of(userReservationResponses);

0 commit comments

Comments
 (0)