Skip to content

[reservation] 미사용 리포지토리 메서드 제거 - #124

Merged
d1ng1724 merged 3 commits into
developfrom
fix/remove-unused-reservation-repository-methods
Sep 3, 2026
Merged

[reservation] 미사용 리포지토리 메서드 제거#124
d1ng1724 merged 3 commits into
developfrom
fix/remove-unused-reservation-repository-methods

Conversation

@d1ng1724

@d1ng1724 d1ng1724 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

개요

ReservationRepository에 남아 있던 죽은 쿼리 메서드 findExpiredReservedReservations를 제거하고, 사용처가 사라진 java.time.LocalDateTime import를 정리하였습니다.

closes #113

본문

제거 근거

findExpiredReservedReservations는 단순 미사용이 아니라 조건 자체가 잘못된 죽은 쿼리였습니다. RESERVED 예약은 startTimenull이라 r.startTime < :threshold 조건은 어떤 행도 반환하지 못합니다. 실제 만료 판정은 reservedAt 기준의 ReservationRepositoryCustomImpl.findExpiredReservations()가 담당하므로, 잘못된 기준으로 재사용될 위험을 없애기 위해 삭제하였습니다.

이슈 체크리스트 대비 범위 축소

  • countActiveReservationsByMachine: 제거하지 않습니다. 이슈 작성 이후 열린 PR #123의 WasherTubCleanMachineGuard.hasActiveReservation()이 통세척 시작·종료 직전 활성 예약 재확인에 이 메서드를 사용하게 되어, 삭제 시 머지 순서와 무관하게 컴파일이 실패합니다. (리뷰 지적 반영, dfe939b)
  • existsByMachineAndStatusIn, ReservationRepositoryCustom.existsActiveReservationByRoomAndMachineType: [reservation] 만료 예약 활성 기준 통일 #110 머지 시점에 이미 제거되어 있어 이번 PR에서는 변경 사항이 없습니다.
  • 테스트 스텁: 예약 관련 테스트가 모두 Mockito 목 기반이라 제거된 메서드를 참조하는 스텁이 없어 정리 대상이 없었습니다.

검증

./gradlew spotlessApply compileJava test 전부 통과하였습니다.

https://claude.ai/code/session_01VVnM26TwXTAKPNa7HxHCJP

findExpiredReservedReservations는 RESERVED 예약의 startTime이 null이라
어떤 행도 반환하지 못하는 죽은 쿼리이며, 실제 만료 판정은 reservedAt 기준의
ReservationRepositoryCustomImpl.findExpiredReservations가 담당한다.
countActiveReservationsByMachine도 호출부가 없어 함께 제거한다.

Closes #113

Claude-Session: https://claude.ai/code/session_01VVnM26TwXTAKPNa7HxHCJP
@d1ng1724 d1ng1724 added 리팩터링 코드를 개선합니다. 삭제 labels Sep 3, 2026

@exijn exijn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

findExpiredReservedReservations 정리는 타당하지만, 현재 열린 PR #123과 함께 반영할 수 없는 삭제가 포함되어 있어 변경을 요청합니다.

@d1ng1724 d1ng1724 self-assigned this Sep 3, 2026
열린 PR #123의 WasherTubCleanMachineGuard가 통세척 시작·종료 직전 활성 예약
재확인에 이 메서드를 사용하고 있어, 삭제 시 머지 순서와 무관하게 컴파일이
실패한다. 조건 자체가 잘못된 findExpiredReservedReservations 삭제만 유지한다.

Claude-Session: https://claude.ai/code/session_01VVnM26TwXTAKPNa7HxHCJP
@d1ng1724
d1ng1724 merged commit 3e92029 into develop Sep 3, 2026
1 check passed
@d1ng1724
d1ng1724 deleted the fix/remove-unused-reservation-repository-methods branch September 3, 2026 11:23
@d1ng1724 d1ng1724 mentioned this pull request Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

리팩터링 코드를 개선합니다. 삭제

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants