Skip to content

(fix) : 정산 상세 입금 확인 요청 ID 추가#51

Merged
sudhdkso merged 4 commits into
developfrom
fix/payment-request-settlement-detail
May 17, 2026
Merged

(fix) : 정산 상세 입금 확인 요청 ID 추가#51
sudhdkso merged 4 commits into
developfrom
fix/payment-request-settlement-detail

Conversation

@sudhdkso
Copy link
Copy Markdown
Contributor

@sudhdkso sudhdkso commented May 17, 2026

#️⃣연관된 이슈

X

🔀반영 브랜치

fix/payment-request-settlement-detail -> develop

🔧변경 사항

  • 정산 상세 조회 응답의 멤버 정보에 대기 중인 입금 확인 요청 ID를 포함했습니다.
  • 입금 확인 승인/거절 시 정산 총무 권한을 검증하도록 변경했습니다.
  • 미구현 상태인 NOTIFICATION_SEND 이벤트 태스크가 생성되지 않도록 주석 처리했습니다.
  • 관련 서비스/컨트롤러/Outbox 테스트를 수정했습니다.

💬리뷰 요구사항(선택)

X

✅ 테스트

  • ./gradlew --no-daemon test --tests '*MemberControllerTest' --tests '*SettlementControllerTest' --tests '*Settlement*' --tests '*PaymentRequest*'
  • ./gradlew --no-daemon test --tests '*OutboxEventPublishExecutorTest'

Summary by CodeRabbit

릴리스 노트

  • 새 기능

    • 정산 상세 조회 시 각 멤버별 대기 중인 결제요청 정보를 함께 제공합니다.
  • 개선 사항

    • 정산 관리 권한 검증 로직을 개선하여 정산 작성자 확인 기반으로 변경했습니다.
  • 변경 사항

    • 정산 완료 시 자동 알림 발송 기능을 일시 비활성화했습니다.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

Warning

Rate limit exceeded

@sudhdkso has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 51 minutes and 1 second before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c89e66e2-9ace-4c3c-9169-fe4559daadc6

📥 Commits

Reviewing files that changed from the base of the PR and between 251ec16 and bc75060.

📒 Files selected for processing (4)
  • src/main/java/com/dnd/moddo/event/application/impl/PaymentRequestReader.java
  • src/main/java/com/dnd/moddo/event/application/impl/PaymentRequestValidator.java
  • src/test/java/com/dnd/moddo/domain/paymentRequest/service/implementation/PaymentRequestReaderTest.java
  • src/test/java/com/dnd/moddo/domain/paymentRequest/service/implementation/PaymentRequestValidatorTest.java
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 주요 변경사항(정산 상세 조회 시 멤버별 입금 확인 요청 ID 추가)을 명확하게 요약하고 있으며, 코드 변경사항들과 직접적으로 관련이 있습니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/payment-request-settlement-detail

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 and usage tips.

@github-actions
Copy link
Copy Markdown

📝 테스트 커버리지 리포트입니다!

File Coverage [92.41%] 🍏
OutboxEventPublishExecutor.java 100% 🍏
PaymentRequestReader.java 95.96% 🍏
PaymentRequestValidator.java 91.95% 🍏
QuerySettlementService.java 85.27% 🍏
Total Project Coverage 70.49%

@sudhdkso sudhdkso marked this pull request as ready for review May 17, 2026 12:32
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8cad24f and 251ec16.

📒 Files selected for processing (12)
  • src/main/java/com/dnd/moddo/event/application/impl/PaymentRequestReader.java
  • src/main/java/com/dnd/moddo/event/application/impl/PaymentRequestValidator.java
  • src/main/java/com/dnd/moddo/event/application/query/QuerySettlementService.java
  • src/main/java/com/dnd/moddo/event/infrastructure/PaymentRequestRepository.java
  • src/main/java/com/dnd/moddo/event/presentation/response/SettlementDetailResponse.java
  • src/main/java/com/dnd/moddo/event/presentation/response/SettlementMemberResponse.java
  • src/main/java/com/dnd/moddo/outbox/application/impl/OutboxEventPublishExecutor.java
  • src/test/java/com/dnd/moddo/domain/outbox/service/implementation/OutboxEventPublishExecutorTest.java
  • src/test/java/com/dnd/moddo/domain/paymentRequest/service/implementation/PaymentRequestReaderTest.java
  • src/test/java/com/dnd/moddo/domain/paymentRequest/service/implementation/PaymentRequestValidatorTest.java
  • src/test/java/com/dnd/moddo/domain/settlement/controller/SettlementControllerTest.java
  • src/test/java/com/dnd/moddo/domain/settlement/service/QuerySettlementServiceTest.java

Comment on lines +125 to +128
java.util.Map<Long, Long> result = paymentRequestReader.findPendingRequestIdByMemberId(1L);

assertThat(result).containsEntry(11L, 100L);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

맵 결과 크기 단언을 추가해 테스트 정확도를 높여주세요.

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.

Suggested change
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.

@github-actions
Copy link
Copy Markdown

📝 테스트 커버리지 리포트입니다!

File Coverage [92.41%] 🍏
OutboxEventPublishExecutor.java 100% 🍏
PaymentRequestReader.java 95.96% 🍏
PaymentRequestValidator.java 91.95% 🍏
QuerySettlementService.java 85.27% 🍏
Total Project Coverage 70.59%

@github-actions
Copy link
Copy Markdown

📝 테스트 커버리지 리포트입니다!

File Coverage [92.96%] 🍏
OutboxEventPublishExecutor.java 100% 🍏
PaymentRequestReader.java 98.04% 🍏
PaymentRequestValidator.java 91.95% 🍏
QuerySettlementService.java 85.27% 🍏
Total Project Coverage 70.55%

@sudhdkso sudhdkso merged commit 907ed72 into develop May 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant