Skip to content

[WTH-434] 회비 수정사항 반영#88

Merged
hyxklee merged 8 commits into
devfrom
fix/WTH-434-회비-유저사이드-내가-참여한-기수만-노출하도록-수정
Jul 7, 2026

Hidden character warning

The head ref may contain hidden characters: "fix/WTH-434-\ud68c\ube44-\uc720\uc800\uc0ac\uc774\ub4dc-\ub0b4\uac00-\ucc38\uc5ec\ud55c-\uae30\uc218\ub9cc-\ub178\ucd9c\ud558\ub3c4\ub85d-\uc218\uc815"
Merged

[WTH-434] 회비 수정사항 반영#88
hyxklee merged 8 commits into
devfrom
fix/WTH-434-회비-유저사이드-내가-참여한-기수만-노출하도록-수정

Conversation

@hyxklee

@hyxklee hyxklee commented Jul 6, 2026

Copy link
Copy Markdown
Member

📌 Summary

어떤 작업인지 한 줄 요약해 주세요.

급한 수정사항 반영했습니다.

  1. 대시보드 부원 공개 여부 반환
  2. 거래내역 local date time으로 저장
  3. 유저사이드에서 접근 가능한 기수만 조회
  4. 총 잔액 추가
  5. 제외 처리 API 구현

📝 Changes

변경사항을 what, why, how로 구분해 작성해 주세요.

What

회비 QA에서 나온 백엔드 반영 사항입니다.

Why

How

📸 Screenshots / Logs

필요시 스크린샷 or 로그를 첨부해주세요.

💡 Reviewer 참고사항

리뷰에 참고할 내용을 작성해주세요.

아 근데 생각해보니 거래일자를 받을 때 시간까지 받긴 좀 그런데.. 어떻게 하는게 좋을까요?

✅ Checklist

  • PR 제목 설정 완료 (WTH-123 인증 필터 설정)
  • 테스트 구현 완료
  • 리뷰어 등록 완료
  • 자체 코드 리뷰 완료

Summary by CodeRabbit

  • New Features
    • 거래 일자를 더 정밀하게 처리하고, 거래 후 잔액이 응답에 함께 표시됩니다.
    • 계정 대시보드/내 계정 조회에서 공개 여부 및 참여 범위에 따라 노출 정보가 개선되었습니다.
    • 납부 대상들을 한 번에 제외하는 기능(PATCH 엔드포인트 및 성공 응답 코드)이 추가되었습니다.
  • Bug Fixes
    • 참여하지 않은 카드널의 계정은 숨겨지도록 접근 범위가 강화되었습니다.
    • 거래 반영 시점의 총잔액 스냅샷이 응답과 저장 데이터에 일관되게 반영됩니다.

@hyxklee hyxklee requested review from JIN921, dalzzy and soo0711 July 6, 2026 13:06
@hyxklee hyxklee self-assigned this Jul 6, 2026
@hyxklee hyxklee added the 🐞 BugFix 버그 수정 label Jul 6, 2026
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@hyxklee, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6304db08-fc8b-49cb-be2e-d10befa224c5

📥 Commits

Reviewing files that changed from the base of the PR and between 851cba3 and 26d633b.

📒 Files selected for processing (3)
  • src/main/kotlin/com/weeth/domain/account/application/usecase/command/ManageAccountPaymentUseCase.kt
  • src/main/resources/db/migration/V9__add_account_transaction_balance_after.sql
  • src/test/kotlin/com/weeth/domain/account/application/usecase/command/ManageAccountPaymentUseCaseTest.kt
📝 Walkthrough

Walkthrough

회비 납부 대상 제외 API, 거래 잔액 스냅샷 저장, 기수 참여 기반 계정 노출 제한, 거래 일시 타입 변경, 거래 정렬 기준 변경이 추가되었고 관련 테스트와 마이그레이션이 함께 수정되었습니다.

Changes

회비 도메인 변경

Layer / File(s) Summary
납부 대상 제외 기능
src/main/kotlin/com/weeth/domain/account/application/dto/request/ExcludePaymentTargetsRequest.kt, src/main/kotlin/com/weeth/domain/account/application/usecase/command/ManageAccountPaymentUseCase.kt, src/main/kotlin/com/weeth/domain/account/presentation/AccountManageController.kt, src/main/kotlin/com/weeth/domain/account/presentation/AccountResponseCode.kt, src/test/kotlin/com/weeth/domain/account/application/usecase/command/ManageAccountPaymentUseCaseTest.kt
납부 대상 ID 목록 요청 DTO, 제외 유스케이스, PATCH /{accountId}/payment-targets/excluded 엔드포인트, 성공 응답 코드, 관련 예외 테스트가 추가되었습니다.
거래 잔액 스냅샷과 응답
src/main/kotlin/com/weeth/domain/account/domain/entity/Account.kt, src/main/kotlin/com/weeth/domain/account/domain/entity/AccountTransaction.kt, src/main/kotlin/com/weeth/domain/account/application/dto/response/AccountTransactionResponse.kt, src/main/kotlin/com/weeth/domain/account/application/mapper/AccountTransactionMapper.kt, src/main/resources/db/migration/V9__add_account_transaction_balance_after.sql, src/test/kotlin/com/weeth/domain/account/application/usecase/query/GetAccountTransactionQueryServiceTest.kt, src/test/kotlin/com/weeth/domain/account/domain/entity/AccountTest.kt, src/test/kotlin/com/weeth/domain/account/domain/repository/AccountRepositoryTest.kt
거래 적용 시점의 잔액을 balanceAfter로 기록하고, 응답과 조회 결과에 반영하며, DB 컬럼과 기존 데이터 채움 마이그레이션을 추가했습니다.
기수 참여 기반 접근 제어
src/main/kotlin/com/weeth/domain/account/application/usecase/MemberAccountAccessResolver.kt, src/main/kotlin/com/weeth/domain/account/application/usecase/query/GetMyAccountQueryService.kt, src/main/kotlin/com/weeth/domain/account/application/dto/response/AccountDashboardResponse.kt, src/main/kotlin/com/weeth/domain/account/application/mapper/AccountDashboardMapper.kt, src/test/kotlin/com/weeth/domain/account/application/usecase/query/GetMyAccountQueryServiceTest.kt, src/test/kotlin/com/weeth/domain/account/application/usecase/query/GetMyAccountTransactionQueryServiceTest.kt
회원의 기수 참여 여부를 추가로 확인해 미참여 장부를 숨기고, 대시보드 응답에 memberVisible을 포함하도록 변경했습니다.
거래 일시 타입과 정렬 계약
src/main/kotlin/com/weeth/domain/account/application/dto/request/SaveAccountTransactionRequest.kt, src/main/kotlin/com/weeth/domain/account/application/dto/request/AccountTransactionSort.kt, src/main/kotlin/com/weeth/domain/account/application/mapper/AccountTransactionMapper.kt, src/test/kotlin/com/weeth/domain/account/application/dto/request/AccountTransactionRequestValidationTest.kt, src/test/kotlin/com/weeth/domain/account/application/usecase/command/ManageAccountTransactionUseCaseTest.kt
transactedAt 요청 타입을 LocalDateTime으로 바꾸고, 거래 정렬 기준을 createdAt 보조키로 조정했습니다.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • Team-Weeth/weeth-server#78: AccountPaymentTarget의 상태 전이와 납부 대상 제외 흐름이 직접 연결됩니다.
  • Team-Weeth/weeth-server#84: 회비 납부 제외와 거래 정렬 계약이 같은 회비 도메인 흐름에서 맞물립니다.
  • Team-Weeth/weeth-server#86: MemberAccountAccessResolver의 참여 기반 접근 제어가 같은 계정 조회 경로를 공유합니다.

Suggested labels: ✨ Feature, 🔨 Refactor

Suggested reviewers: JIN921, soo0711

Poem

나는 토끼, 장부를 살짝 훑어봐요
잔액은 스냅샷으로 또각, 또각 남겨요
참여한 기수만 문을 열고
미납 대상은 조용히 빼고
날짜도 정렬도 반짝 정리! 🐰📒

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning Summary는 있으나 Changes의 Why/How가 비어 있어 템플릿 요구사항을 충분히 충족하지 못합니다. Changes에 What/Why/How를 모두 채우고, 필요한 경우 Screenshots/Logs와 리뷰 참고사항도 구체화해 주세요.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 회비 수정사항 반영이라는 핵심 변경을 간결하게 잘 요약합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/WTH-434-회비-유저사이드-내가-참여한-기수만-노출하도록-수정

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.

@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.

Actionable comments posted: 4

🧹 Nitpick comments (1)
src/main/resources/db/migration/V9__add_account_transaction_balance_after.sql (1)

1-30: 🧹 Nitpick | 🔵 Trivial

대용량 테이블 마이그레이션 시 락 영향 검토 권장.

ADD COLUMN → 윈도우 함수 UPDATE JOIN → 추가 UPDATEMODIFY COLUMN NOT NULL로 이어지는 4단계 마이그레이션은 account_transaction 테이블 크기가 클 경우 처리 시간과 락 범위가 커질 수 있습니다. 운영 배포 시 저트래픽 시간대 실행이나 온라인 스키마 변경 도구 사용을 고려해보세요.

🤖 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/main/resources/db/migration/V9__add_account_transaction_balance_after.sql`
around lines 1 - 30, Review the V9 migration for account_transaction to
account_transaction.balance_after and account_transaction.UPDATE paths: this
four-step ALTER/UPDATE/MODIFY sequence can cause long locks on large tables.
Adjust the migration plan to reduce operational impact by considering an online
schema change approach or splitting the backfill and NOT NULL enforcement into
safer deployment steps, and keep the relevant logic centered around the
balance_after backfill and final NOT NULL conversion.
🤖 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/kotlin/com/weeth/domain/account/application/dto/request/SaveAccountTransactionRequest.kt`:
- Around line 30-31: `SaveAccountTransactionRequest`의 `transactedAt` 타입이
`LocalDateTime`으로 바뀌었으므로, `@Schema`의 설명과 예시를 이에 맞게 갱신하세요. `transactedAt` 주석에서 날짜
전용 표현을 제거하고, ISO-8601 `LocalDateTime` 형식이 드러나는 예시로 바꿔 Swagger 문서와 실제 Jackson
역직렬화 형식이 일치하도록 수정하면 됩니다.
- Line 31: `SaveAccountTransactionRequest` and the update flow use inconsistent
timestamp precision, causing `ManageAccountTransactionUseCase.update()` to
truncate update times to midnight. Update `UpdateAccountTransactionRequest` to
use `LocalDateTime` like `SaveAccountTransactionRequest`, and adjust
`ManageAccountTransactionUseCase.update()` to pass through the provided datetime
without calling `atStartOfDay()`, keeping save and update behavior aligned.

In
`@src/main/kotlin/com/weeth/domain/account/application/usecase/command/ManageAccountPaymentUseCase.kt`:
- Around line 110-113: The pre-check in ManageAccountPaymentUseCase currently
only validates paymentStatus, so targets already in EXCLUDED can slip through
because AccountPaymentTarget.exclude() resets the status to UNPAID. Update the
validation in ManageAccountPaymentUseCase to also inspect targetStatus (or an
equivalent field) before proceeding, and reject already excluded targets with
the appropriate exception/response instead of treating them as valid. Use the
existing symbols AccountPaymentTarget.exclude, AccountPaymentStatus.UNPAID, and
the target collection check in ManageAccountPaymentUseCase to place the new
guard alongside the current all-or-nothing validation.

In
`@src/main/resources/db/migration/V9__add_account_transaction_balance_after.sql`:
- Around line 4-23: The backfill in the
`V9__add_account_transaction_balance_after` migration computes `balance_after`
from `transacted_at`, but there is no separate applied/posted timestamp to
guarantee that matches the real `Account.applyTransaction()` order. Update the
migration to either derive balances from the actual apply order if such a field
exists, or explicitly document in the migration that `transactedAt` is the
source of truth and that the backfill intentionally follows that ordering. Make
sure the `UPDATE account_transaction` / running-balance logic reflects the
chosen ordering consistently.

---

Nitpick comments:
In
`@src/main/resources/db/migration/V9__add_account_transaction_balance_after.sql`:
- Around line 1-30: Review the V9 migration for account_transaction to
account_transaction.balance_after and account_transaction.UPDATE paths: this
four-step ALTER/UPDATE/MODIFY sequence can cause long locks on large tables.
Adjust the migration plan to reduce operational impact by considering an online
schema change approach or splitting the backfill and NOT NULL enforcement into
safer deployment steps, and keep the relevant logic centered around the
balance_after backfill and final NOT NULL conversion.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ea7ef56a-60b4-4883-bc17-9543b2647c6a

📥 Commits

Reviewing files that changed from the base of the PR and between 6d8e769 and 4c04477.

📒 Files selected for processing (22)
  • src/main/kotlin/com/weeth/domain/account/application/dto/request/ExcludePaymentTargetsRequest.kt
  • src/main/kotlin/com/weeth/domain/account/application/dto/request/SaveAccountTransactionRequest.kt
  • src/main/kotlin/com/weeth/domain/account/application/dto/response/AccountDashboardResponse.kt
  • src/main/kotlin/com/weeth/domain/account/application/dto/response/AccountTransactionResponse.kt
  • src/main/kotlin/com/weeth/domain/account/application/mapper/AccountDashboardMapper.kt
  • src/main/kotlin/com/weeth/domain/account/application/mapper/AccountTransactionMapper.kt
  • src/main/kotlin/com/weeth/domain/account/application/usecase/MemberAccountAccessResolver.kt
  • src/main/kotlin/com/weeth/domain/account/application/usecase/command/ManageAccountPaymentUseCase.kt
  • src/main/kotlin/com/weeth/domain/account/application/usecase/query/GetMyAccountQueryService.kt
  • src/main/kotlin/com/weeth/domain/account/domain/entity/Account.kt
  • src/main/kotlin/com/weeth/domain/account/domain/entity/AccountTransaction.kt
  • src/main/kotlin/com/weeth/domain/account/presentation/AccountManageController.kt
  • src/main/kotlin/com/weeth/domain/account/presentation/AccountResponseCode.kt
  • src/main/resources/db/migration/V9__add_account_transaction_balance_after.sql
  • src/test/kotlin/com/weeth/domain/account/application/dto/request/AccountTransactionRequestValidationTest.kt
  • src/test/kotlin/com/weeth/domain/account/application/usecase/command/ManageAccountPaymentUseCaseTest.kt
  • src/test/kotlin/com/weeth/domain/account/application/usecase/command/ManageAccountTransactionUseCaseTest.kt
  • src/test/kotlin/com/weeth/domain/account/application/usecase/query/GetAccountTransactionQueryServiceTest.kt
  • src/test/kotlin/com/weeth/domain/account/application/usecase/query/GetMyAccountQueryServiceTest.kt
  • src/test/kotlin/com/weeth/domain/account/application/usecase/query/GetMyAccountTransactionQueryServiceTest.kt
  • src/test/kotlin/com/weeth/domain/account/domain/entity/AccountTest.kt
  • src/test/kotlin/com/weeth/domain/account/domain/repository/AccountRepositoryTest.kt

@JIN921 JIN921 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.

그러게요 거래내역 입력할 때 시간까지 받기 애매하긴.. 한데... 정말 정확하게 정렬하려면 시간까지 입력을 받고 아니라면,,

날짜가 다르면 그대로 정렬하고 날짜가 같다면 거래내역 등록한 시각 기준으로 정렬..? 어차피 같은 날짜안에서의 정렬은 크게 중요할 거 같지 않아서용
→ 근데 그럴거면 걍 지금대로 둬도 괜찮을 거 같아요... 아닌가.. 어렵다....

@soo0711 soo0711 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

수고하셨습니다!! 코드래빗 리뷰만 참고하면 될 것 같아용

그리구 저도 거래내역을 받을 땐 날짜만 받는게 더 자연스러워보입니닷.. 정렬은 유진님이 말씀하신 것처럼 거래일자 DESC → 등록시각 DESC가 어떨까욤

@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 (2)
src/main/kotlin/com/weeth/domain/account/application/dto/request/AccountTransactionSort.kt (2)

18-21: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

정렬 옵션별 보조키 전략 불일치

LATEST/OLDESTcreatedAt을 보조키로 쓰지만, AMOUNT_DESC/AMOUNT_ASC는 여전히 "id"를 보조키로 사용합니다. 동일 파일 내에서 안정 정렬 전략이 일관되지 않아 유지보수 시 혼란을 줄 수 있습니다.

🤖 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/main/kotlin/com/weeth/domain/account/application/dto/request/AccountTransactionSort.kt`
around lines 18 - 21, 정렬 옵션별 보조키 전략이 `AccountTransactionSort`에서 일관되지 않게 섞여 있습니다.
`LATEST`/`OLDEST`와 같은 안정 정렬 기준에 맞춰 `AMOUNT_DESC`/`AMOUNT_ASC`도 동일한 보조키 전략을 사용하도록
정리하고, `Sort.by(...)` 및 `Sort.Order...`를 정의한 `AccountTransactionSort` enum의 각
케이스가 같은 기준으로 정렬되도록 수정하세요.

6-7: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

LATEST/OLDEST는 마지막 tie-breaker에 id를 넣는 편이 안전합니다
createdAt은 같은 시각에 충돌할 수 있어 페이지 순서가 흔들릴 수 있습니다. transactedAt, createdAt, id로 맞추거나, 현재 인덱스(transactedAt, account_transaction_id)에 맞춰 transactedAt, id로 정렬을 맞추는 쪽이 더 낫습니다.

🤖 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/main/kotlin/com/weeth/domain/account/application/dto/request/AccountTransactionSort.kt`
around lines 6 - 7, The sorting strategy in AccountTransactionSort should use a
stable final tie-breaker instead of relying on createdAt, which can collide for
records created at the same time. Update the LATEST/OLDEST ordering to end with
id, or align it with the existing account transaction index by sorting with
transactedAt and id; make the change in AccountTransactionSort so paging remains
deterministic.
🤖 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/main/kotlin/com/weeth/domain/account/application/dto/request/AccountTransactionSort.kt`:
- Around line 18-21: 정렬 옵션별 보조키 전략이 `AccountTransactionSort`에서 일관되지 않게 섞여 있습니다.
`LATEST`/`OLDEST`와 같은 안정 정렬 기준에 맞춰 `AMOUNT_DESC`/`AMOUNT_ASC`도 동일한 보조키 전략을 사용하도록
정리하고, `Sort.by(...)` 및 `Sort.Order...`를 정의한 `AccountTransactionSort` enum의 각
케이스가 같은 기준으로 정렬되도록 수정하세요.
- Around line 6-7: The sorting strategy in AccountTransactionSort should use a
stable final tie-breaker instead of relying on createdAt, which can collide for
records created at the same time. Update the LATEST/OLDEST ordering to end with
id, or align it with the existing account transaction index by sorting with
transactedAt and id; make the change in AccountTransactionSort so paging remains
deterministic.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 477dfe8b-ef9b-46f2-890d-329285013c61

📥 Commits

Reviewing files that changed from the base of the PR and between 4c04477 and 851cba3.

📒 Files selected for processing (4)
  • src/main/kotlin/com/weeth/domain/account/application/dto/request/AccountTransactionSort.kt
  • src/main/kotlin/com/weeth/domain/account/application/dto/response/AccountTransactionResponse.kt
  • src/main/kotlin/com/weeth/domain/account/application/mapper/AccountTransactionMapper.kt
  • src/test/kotlin/com/weeth/domain/account/application/usecase/query/GetAccountTransactionQueryServiceTest.kt
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/kotlin/com/weeth/domain/account/application/mapper/AccountTransactionMapper.kt
  • src/test/kotlin/com/weeth/domain/account/application/usecase/query/GetAccountTransactionQueryServiceTest.kt

@hyxklee

hyxklee commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

거래내역 일자는 원복했습니당 그냥 일자만 받도록

@hyxklee hyxklee merged commit 49f0cad into dev Jul 7, 2026
2 checks passed
@hyxklee hyxklee deleted the fix/WTH-434-회비-유저사이드-내가-참여한-기수만-노출하도록-수정 branch July 7, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 BugFix 버그 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants