(fix) : 정산 상세 입금 확인 요청 ID 추가#51
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/main/java/com/dnd/moddo/event/application/impl/PaymentRequestReader.java`:
- Around line 64-71: The current implementation in
PaymentRequestReader.findPendingRequestIdByMemberId uses Collectors.toMap with a
merge function that silently keeps the first value on duplicate
PaymentRequest::getRequestMemberId, which hides data issues and makes results
order-dependent; change this to either fail fast by throwing an exception in the
merge function (e.g., throw new IllegalStateException including the duplicate
requestMemberId and both IDs) or apply an explicit disambiguation policy (e.g.,
pick the latest request by comparing PaymentRequest::getId or a timestamp and
return that ID), and ensure the log/exception includes identifying info from
paymentRequestRepository.findBySettlementIdAndStatus results to aid debugging.
In
`@src/main/java/com/dnd/moddo/event/application/impl/PaymentRequestValidator.java`:
- Around line 28-31: In validateProcessRequest in PaymentRequestValidator,
perform the manager permission check before any state validation to avoid
leaking status via exceptions: call validateManagerPermission(paymentRequest,
userId) first and only then call validatePendingStatus(paymentRequest); update
the method body accordingly so permission checks (validateManagerPermission) run
prior to status checks (validatePendingStatus).
In
`@src/test/java/com/dnd/moddo/domain/paymentRequest/service/implementation/PaymentRequestReaderTest.java`:
- Around line 125-128: The test in PaymentRequestReaderTest should also assert
the expected map size to prevent extra unexpected entries; after calling
paymentRequestReader.findPendingRequestIdByMemberId(1L) and before or alongside
assertThat(result).containsEntry(11L, 100L), add an assertion that result has
the exact expected size (e.g., assertThat(result).hasSize(<expectedCount>))
referencing the local variable result and the tested method
findPendingRequestIdByMemberId to lock the expected number of entries.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 634c0eff-7dee-4f6f-aabc-32a628559fc7
📒 Files selected for processing (12)
src/main/java/com/dnd/moddo/event/application/impl/PaymentRequestReader.javasrc/main/java/com/dnd/moddo/event/application/impl/PaymentRequestValidator.javasrc/main/java/com/dnd/moddo/event/application/query/QuerySettlementService.javasrc/main/java/com/dnd/moddo/event/infrastructure/PaymentRequestRepository.javasrc/main/java/com/dnd/moddo/event/presentation/response/SettlementDetailResponse.javasrc/main/java/com/dnd/moddo/event/presentation/response/SettlementMemberResponse.javasrc/main/java/com/dnd/moddo/outbox/application/impl/OutboxEventPublishExecutor.javasrc/test/java/com/dnd/moddo/domain/outbox/service/implementation/OutboxEventPublishExecutorTest.javasrc/test/java/com/dnd/moddo/domain/paymentRequest/service/implementation/PaymentRequestReaderTest.javasrc/test/java/com/dnd/moddo/domain/paymentRequest/service/implementation/PaymentRequestValidatorTest.javasrc/test/java/com/dnd/moddo/domain/settlement/controller/SettlementControllerTest.javasrc/test/java/com/dnd/moddo/domain/settlement/service/QuerySettlementServiceTest.java
| java.util.Map<Long, Long> result = paymentRequestReader.findPendingRequestIdByMemberId(1L); | ||
|
|
||
| assertThat(result).containsEntry(11L, 100L); | ||
| } |
There was a problem hiding this comment.
맵 결과 크기 단언을 추가해 테스트 정확도를 높여주세요.
containsEntry만으로는 불필요한 추가 엔트리가 있어도 테스트가 통과합니다. 기대 개수를 함께 고정해 회귀를 더 잘 잡는 게 좋습니다.
제안 수정안
java.util.Map<Long, Long> result = paymentRequestReader.findPendingRequestIdByMemberId(1L);
+assertThat(result).hasSize(1);
assertThat(result).containsEntry(11L, 100L);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| java.util.Map<Long, Long> result = paymentRequestReader.findPendingRequestIdByMemberId(1L); | |
| assertThat(result).containsEntry(11L, 100L); | |
| } | |
| java.util.Map<Long, Long> result = paymentRequestReader.findPendingRequestIdByMemberId(1L); | |
| assertThat(result).hasSize(1); | |
| assertThat(result).containsEntry(11L, 100L); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/test/java/com/dnd/moddo/domain/paymentRequest/service/implementation/PaymentRequestReaderTest.java`
around lines 125 - 128, The test in PaymentRequestReaderTest should also assert
the expected map size to prevent extra unexpected entries; after calling
paymentRequestReader.findPendingRequestIdByMemberId(1L) and before or alongside
assertThat(result).containsEntry(11L, 100L), add an assertion that result has
the exact expected size (e.g., assertThat(result).hasSize(<expectedCount>))
referencing the local variable result and the tested method
findPendingRequestIdByMemberId to lock the expected number of entries.
📝 테스트 커버리지 리포트입니다!
|
📝 테스트 커버리지 리포트입니다!
|
#️⃣연관된 이슈
X
🔀반영 브랜치
fix/payment-request-settlement-detail -> develop
🔧변경 사항
NOTIFICATION_SEND이벤트 태스크가 생성되지 않도록 주석 처리했습니다.💬리뷰 요구사항(선택)
X
✅ 테스트
./gradlew --no-daemon test --tests '*MemberControllerTest' --tests '*SettlementControllerTest' --tests '*Settlement*' --tests '*PaymentRequest*'./gradlew --no-daemon test --tests '*OutboxEventPublishExecutorTest'Summary by CodeRabbit
릴리스 노트
새 기능
개선 사항
변경 사항