Skip to content

feat: 어드민 대여 내역 장기 미반납 필터 - #520

Merged
birdieHyun merged 1 commit into
devfrom
feature/512
Oct 9, 2026
Merged

birdieHyun merged 1 commit into
devfrom
feature/512

Conversation

@birdieHyun

Copy link
Copy Markdown
Member

Closes #512

🟢 구현내용

  • GET /admin/rent/histories에 overdue 쿼리 파라미터 추가. true면 대여 후 14일이 지났는데 반납하지 않은 대여 내역만 조회한다
    • 조건: returned_at IS NULL AND rented_at <= 지금 - 14일
    • 목록과 전체 개수(countOfAllHistories)에 같이 적용. 기존 refunded 필터와 함께 쓸 수 있다
    • 없거나 false면 필터 없음 (기존 동작 그대로)
  • 반납 기한을 History.RETURN_DEADLINE_DAYS(14일) 상수로 정리
  • REST Docs에 대여 내역 조회의 쿼리 파라미터(refunded, overdue, page, size) 문서 추가
  • 문서: docs/feature/512.md

🧩 고민과 해결과정

반납 기한이 두 군데 있었음

위치 기한 사용 여부
RentService.toSingleHistoryResponse 14일 사용 (앱 내 대여 내역의 반납 예정일)
History.ofUserHistory 7일 main 코드에서 안 씀

두 함수가 반납 기한 말고는 같아서, 상수를 만들고 History.ofUserHistory 하나만 남겼습니다. 앱에 나가는 반납 예정일은 그대로 14일입니다. 이후 스탬프의 '정상 반납 완료' 미션(#514)도 이 상수를 쓰면 됩니다.

테스트

  • RentRepositoryImplTest 추가 (@DataJpaTest, H2): 반납 기한 지남+미반납 / 기한 안+미반납 / 기한 지남+반납 세 건 중 첫 번째만 조회되는지, 개수도 같은지 확인
  • HistoryTest: 반납 예정일 기대값 7일 → 상수

참고

  • hotfix: 대여 시간 이중 KST 변환 제거 #519(시간대 이중 변환)와 HistoryTest.kt 같은 줄을 고쳐서, 먼저 머지되는 쪽에 맞춰 다른 쪽을 리베이스해야 합니다.
  • 머지 안 된 codex/필터링-기능에-지점과-입금-여부-추가 브랜치가 HistoryFilterRequest, RentRepositoryImpl에 지점·입금 필터를 추가해 둔 상태라, 그 브랜치를 살린다면 충돌을 정리해야 합니다.

🤖 Generated with Claude Code

overdue=true면 대여 후 14일이 지났는데 반납하지 않은 대여 내역만 조회한다.
반납 기한을 History.RETURN_DEADLINE_DAYS 상수로 정리하고, 반납 기한만 다르던
RentService.toSingleHistoryResponse를 History.ofUserHistory로 합쳤다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@birdieHyun birdieHyun added the feat 새로운 기능 추가 label Oct 9, 2026
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e2b5c72c-da15-4934-9585-bab18878640e
📥 Commits

Reviewing files that changed from the base of the PR and between 3361401 and 0ff089d.

📒 Files selected for processing (9)
  • docs/feature/512.md
  • src/docs/asciidoc/api/admin/rent.adoc
  • src/main/kotlin/upbrella/be/rent/dto/request/HistoryFilterRequest.kt
  • src/main/kotlin/upbrella/be/rent/entity/History.kt
  • src/main/kotlin/upbrella/be/rent/repository/RentRepositoryImpl.kt
  • src/main/kotlin/upbrella/be/rent/service/RentService.kt
  • src/test/kotlin/upbrella/be/rent/controller/RentControllerTest.kt
  • src/test/kotlin/upbrella/be/rent/entity/HistoryTest.kt
  • src/test/kotlin/upbrella/be/rent/repository/RentRepositoryImplTest.kt
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@birdieHyun
birdieHyun merged commit 4b91d1b into dev Oct 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat 새로운 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

어드민 대여 내역 장기 미반납 필터

1 participant