diff --git a/src/main/kotlin/roomescape/schedule/business/ScheduleService.kt b/src/main/kotlin/roomescape/schedule/business/ScheduleService.kt index e080dae5..e72f7c6d 100644 --- a/src/main/kotlin/roomescape/schedule/business/ScheduleService.kt +++ b/src/main/kotlin/roomescape/schedule/business/ScheduleService.kt @@ -69,16 +69,6 @@ class ScheduleService( throw ScheduleException(ScheduleErrorCode.SCHEDULE_NOT_AVAILABLE) } - @Transactional(readOnly = true) - fun findScheduleOverviewById(id: Long): ScheduleOverviewResponse { - val overview: ScheduleOverview = scheduleRepository.findOverviewByIdOrNull(id) ?: run { - log.warn { "[ScheduleService.findScheduleOverview] 일정 개요 조회 실패: id=$id" } - throw ScheduleException(ScheduleErrorCode.SCHEDULE_NOT_FOUND) - } - - return overview.toOverviewResponse() - } - // ======================================== // All-Admin (본사, 매장 모두 사용가능) // ======================================== @@ -181,6 +171,16 @@ class ScheduleService( } } + @Transactional(readOnly = true) + fun findScheduleOverviewById(id: Long): ScheduleOverviewResponse { + val overview: ScheduleOverview = scheduleRepository.findOverviewByIdOrNull(id) ?: run { + log.warn { "[ScheduleService.findScheduleOverview] 일정 개요 조회 실패: id=$id" } + throw ScheduleException(ScheduleErrorCode.SCHEDULE_NOT_FOUND) + } + + return overview.toOverviewResponse() + } + // ======================================== // Common (공통 메서드) // ======================================== diff --git a/src/test/kotlin/roomescape/reservation/ReservationApiTest.kt b/src/test/kotlin/roomescape/reservation/ReservationApiTest.kt index 92dc8da4..53be12c3 100644 --- a/src/test/kotlin/roomescape/reservation/ReservationApiTest.kt +++ b/src/test/kotlin/roomescape/reservation/ReservationApiTest.kt @@ -338,13 +338,13 @@ class ReservationApiTest( runTest( token = userToken, on = { - get("/reservations/summary") + get("/reservations/overview") }, expect = { statusCode(HttpStatus.OK.value()) body("data.reservations.size()", equalTo(3)) assertProperties( - props = setOf("id", "themeName", "date", "startAt", "status"), + props = setOf("id", "storeName", "themeName", "date", "startFrom", "endAt", "status"), propsNameIfList = "reservations" ) } @@ -596,7 +596,9 @@ class ReservationApiTest( }, expect = { statusCode(HttpStatus.OK.value()) - assertProperties(props = setOf("id", "user", "applicationDateTime", "payment")) + assertProperties(props = setOf("id", "reserver", "user", "applicationDateTime", "payment")) + assertProperties(props = setOf("name", "contact", "participantCount", "requirement"), propsNameIfList = "reserver") + assertProperties(props = setOf("id", "name", "phone"), propsNameIfList = "user") } ).also { it.extract().path("data.id") shouldBe reservation.id