Skip to content

(fix) : 멤버 정산내역 입금 요청 상태 노출#61

Merged
sudhdkso merged 1 commit into
developfrom
fix/payment-request-settlement-detail
Jun 6, 2026
Merged

(fix) : 멤버 정산내역 입금 요청 상태 노출#61
sudhdkso merged 1 commit into
developfrom
fix/payment-request-settlement-detail

Conversation

@sudhdkso

@sudhdkso sudhdkso commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

#️⃣연관된 이슈

X

🔀반영 브랜치

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

🔧변경 사항

  • 멤버별 정산내역 조회 시 일반 멤버에게도 입금 확인 요청 상태와 표시명을 내려주도록 수정했습니다.
  • 총무가 아닌 경우 입금 확인 요청 ID는 노출하지 않도록 유지했습니다.
  • 관련 서비스 테스트를 수정했습니다.

💬리뷰 요구사항(선택)

X

Summary by CodeRabbit

릴리스 노트

  • 버그 수정
    • 결제 요청 정보 조회 시 사용자 권한에 따른 접근 제어가 개선되었습니다. 관리자가 아닌 사용자의 경우 결제 요청 상태 정보는 조회되지만 결제 요청 식별자는 노출되지 않도록 수정되었습니다.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Need the big picture first? Review this PR in Change Stack to see what changed before going file by file.

Review Change Stack

전체 요약

경비 상세 조회 응답에서 매니저 권한 여부에 따라 결제요청 정보 노출을 제어하는 기능 변경. 응답 모델 시그니처 확장, 서비스 계층의 항상 조회 패턴, 테스트 검증 정렬이 포함.

변경사항

경비 응답 모델 및 접근 제어 로직

계층 / 파일 요약
응답 모델 시그니처 및 조건 로직
src/main/java/com/dnd/moddo/event/presentation/response/MemberExpenseItemResponse.java
of(...) 팩토리 메서드에 boolean isManager 파라미터 추가. paymentRequestId 설정 조건이 paymentRequest != null && isManager로 변경되어 매니저가 아닌 경우 결제요청 ID는 null.
서비스 로직에서 항상 조회 및 권한 정보 전달
src/main/java/com/dnd/moddo/event/application/query/QueryMemberExpenseService.java
findMemberExpenseDetailsBySettlementId에서 isManager 계산 (settlement.isWriter(userId)) 및 paymentRequestByMemberId 항상 조회. findMemberExpenseDetailByAppointmentMember 호출 시 paymentRequestByMemberIdisManager 추가 전달. 헬퍼 메서드는 응답 생성 시 isManager를 모델에 전달.
비매니저 시나리오 검증
src/test/java/com/dnd/moddo/domain/memberExpense/service/QueryMemberExpenseServiceTest.java
paymentRequestReader.findLatestRequestByMemberId(groupId) stub 추가로 PENDING 상태/"확인중" 라벨 제공. 응답 검증을 PENDING/"확인중"으로 기대하도록 변경. 메서드 호출 검증 never()times(1). paymentRequestId null 기대 유지로 접근 제어 검증.

예상 코드 리뷰 난이도

🎯 2 (Simple) | ⏱️ ~12 분

관련 PR

  • moddo-kr/moddo-backend#57: 동일한 QueryMemberExpenseService 메서드들과 MemberExpenseItemResponse.of() 시그니처 변경을 다루며, 매니저 여부에 따른 결제요청 조건부 포함 로직을 구현하는 관련 변경.
  • moddo-kr/moddo-backend#59: 동일 코드 경로에서 MemberExpenseItemResponse.of() 시그니처 및 PaymentRequestSummaryResponse 전달 방식을 변경하는 직접 겹치는 변경.

시 한 수

🐰 결제 요청의 문이 열리고,
권한자만 그 내용을 보며,
테스트는 항상 진실을 증명하네!
조건부 응답, 깔끔하게 제어되어,
모둠의 경비는 안전하게 보관된다.

🚥 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 제목이 변경 사항의 핵심을 명확하게 설명하고 있습니다. 멤버 정산내역 조회 시 입금 요청 상태를 노출하는 것이 주요 변경 사항이며, 제목이 이를 정확히 반영하고 있습니다.
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

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

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

File Coverage [99.03%] 🍏
QueryMemberExpenseService.java 99.03% 🍏
Total Project Coverage 71.43%

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/test/java/com/dnd/moddo/domain/memberExpense/service/QueryMemberExpenseServiceTest.java (1)

159-188: ⚡ Quick win

비총무 시나리오는 컨트롤러 레벨 계약도 같이 고정해 두는 편이 좋겠습니다.

지금은 서비스 DTO까지만 검증해서, JSON 직렬화에서 paymentRequestId만 숨기고 paymentRequestStatus/paymentRequestStatusLabel은 계속 내려줘야 하는 계약 회귀를 바로 잡기 어렵습니다. src/test/java/com/dnd/moddo/domain/memberExpense/controller/MemberExpenseControllerTest.java:53-63와 같은 위치에 비총무 케이스를 하나 추가해 두면 이번 변경 의도가 API 경계까지 고정됩니다.

🤖 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/memberExpense/service/QueryMemberExpenseServiceTest.java`
around lines 159 - 188, Add a controller-level test to lock the API contract for
non-manager flows: in MemberExpenseControllerTest create a test (mirror the
service test findMemberExpenseDetailsBySettlementId_Success_WhenNotManager) that
performs an HTTP call to the endpoint handled by the controller (use the same
request params/groupId and a non-manager user) and asserts the JSON response
hides paymentRequestId (absent or null) while still returning
paymentRequestStatus and paymentRequestStatusLabel with expected values; this
ensures the controller serialization/DTO mapping matches the service behavior
and prevents regressions at the API boundary.
🤖 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.

Nitpick comments:
In
`@src/test/java/com/dnd/moddo/domain/memberExpense/service/QueryMemberExpenseServiceTest.java`:
- Around line 159-188: Add a controller-level test to lock the API contract for
non-manager flows: in MemberExpenseControllerTest create a test (mirror the
service test findMemberExpenseDetailsBySettlementId_Success_WhenNotManager) that
performs an HTTP call to the endpoint handled by the controller (use the same
request params/groupId and a non-manager user) and asserts the JSON response
hides paymentRequestId (absent or null) while still returning
paymentRequestStatus and paymentRequestStatusLabel with expected values; this
ensures the controller serialization/DTO mapping matches the service behavior
and prevents regressions at the API boundary.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2393d776-8409-4b8e-ae9b-3e01cbdd4111

📥 Commits

Reviewing files that changed from the base of the PR and between b3ee018 and dbce585.

📒 Files selected for processing (3)
  • src/main/java/com/dnd/moddo/event/application/query/QueryMemberExpenseService.java
  • src/main/java/com/dnd/moddo/event/presentation/response/MemberExpenseItemResponse.java
  • src/test/java/com/dnd/moddo/domain/memberExpense/service/QueryMemberExpenseServiceTest.java

@sudhdkso sudhdkso merged commit 952af6e into develop Jun 6, 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