Conversation
📝 Walkthrough개요
변경사항
예상 코드 리뷰 소요 시간🎯 1 (Trivial) | ⏱️ ~2분 추천 리뷰어
시
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/java/com/eatsfine/domain/booking/service/BookingQueryServiceImpl.java (1)
183-187:⚠️ Potential issue | 🟠 Majorstatus 파싱 실패(IllegalArgumentException)를 도메인 예외로 변환해야 합니다.
Line [186]의
BookingStatus.valueOf(status)는 잘못된 문자열 입력 시IllegalArgumentException을 던져 500으로 노출될 수 있습니다. 허용값 검증 후BookingException으로 매핑해 일관된 에러 응답을 반환하세요. (ALL비교도equalsIgnoreCase권장)As per coding guidelines, "1. 예외 처리 - RuntimeException을 남발하지 않고, 의미 있는 커스텀 예외를 사용하는지 검토." 그리고 "5. 입력 검증 및 보안 -
@Valid, Bean Validation 등을 통한 입력값 검증이 되어 있는지."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/main/java/com/eatsfine/domain/booking/service/BookingQueryServiceImpl.java` around lines 183 - 187, Validate and normalize the incoming status string in BookingQueryServiceImpl before calling BookingStatus.valueOf: use equalsIgnoreCase for the "ALL" check, and wrap the conversion in a try/catch that catches IllegalArgumentException and throws a domain BookingException (with a clear message about invalid status) so invalid inputs map to a controlled domain error; update the branch that currently calls BookingStatus.valueOf(status) to perform this validation/exception mapping and then call bookingRepository.findAllByUserAndStatus(user, bookingStatus, pageRequest).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@src/main/java/com/eatsfine/domain/booking/service/BookingQueryServiceImpl.java`:
- Line 176: In BookingQueryServiceImpl, the PageRequest.of(page, 10,
Sort.by("bookingDate").descending()) call can throw a runtime exception if the
input variable page is null or negative; update the method that constructs the
PageRequest to validate the page parameter (check if page == null or page < 0)
and either normalize it to a safe default (e.g., page = 0) or throw a controlled
validation exception (e.g., BadRequestException or a custom
PageParameterException) which your controller/exception handler maps to HTTP
400, then use the validated/normalized page when calling PageRequest.of(...) so
the API no longer results in a 500 for invalid page inputs.
---
Outside diff comments:
In
`@src/main/java/com/eatsfine/domain/booking/service/BookingQueryServiceImpl.java`:
- Around line 183-187: Validate and normalize the incoming status string in
BookingQueryServiceImpl before calling BookingStatus.valueOf: use
equalsIgnoreCase for the "ALL" check, and wrap the conversion in a try/catch
that catches IllegalArgumentException and throws a domain BookingException (with
a clear message about invalid status) so invalid inputs map to a controlled
domain error; update the branch that currently calls
BookingStatus.valueOf(status) to perform this validation/exception mapping and
then call bookingRepository.findAllByUserAndStatus(user, bookingStatus,
pageRequest).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1f257947-bad3-4f89-bc99-9bd3ae2ab915
📒 Files selected for processing (1)
src/main/java/com/eatsfine/domain/booking/service/BookingQueryServiceImpl.java
* Create bug report template in Korean Added a bug report template in Korean with fields for description, reproduction steps, expected behavior, actual behavior, screenshots/logs, root cause analysis, and references. * [FIX]: 예약 내역 조회 에러 Transactional(readOnly = true) 어노테이션 추가 (#155)
💡 작업 개요
✅ 작업 내용
🧪 테스트 내용
📝 기타 참고 사항
Summary by CodeRabbit
릴리스 노트
참고: 이번 업데이트는 사용자에게 보이는 기능 변화는 없습니다.