Conversation
|
Warning Review limit reached
More reviews will be available in 53 minutes and 5 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughGroupHeaderResponse 스키마를 확장(타입 변경 포함)하고, 모킹/API 훅과 컴포넌트(ExpenseDetailPage, ExpenseTimeHeader, BottomAction)의 데이터 흐름을 headerData 중심으로 재구성하며 관련 쿼리 무효화 경로를 확장했습니다. 변경사항정산 페이지 멤버 집계 리팩토링
관련 PR
제안 레이블
개요GroupHeaderResponse 인터페이스에 멤버 집계 필드(totalMemberCount, completedMemberCount)를 추가하고, 이를 통해 ExpenseDetailPage와 ExpenseTimeHeader의 데이터 흐름을 useGetMemberExpenseDetails 기반에서 useGetGroupHeader 기반으로 통합했습니다. 변경사항정산 페이지 멤버 집계 리팩토링
관련 PR
제안 레이블
시
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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 |
Deploying moddo-frontend with
|
| Latest commit: |
0a3063f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a329a105.moddo-frontend.pages.dev |
| Branch Preview URL: | https://fix-md-41.moddo-frontend.pages.dev |
# Conflicts: # src/pages/expenseDetail/ExpenseDetailPage.tsx # src/pages/expenseDetail/ui/ExpenseTimeHeader/index.stories.tsx # src/pages/expenseDetail/ui/ExpenseTimeHeader/index.tsx
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/mocks/handlers/group.ts`:
- Around line 110-114: The mocked groupHeader response returned from
HttpResponse.json currently spreads dummyGroups[0] and only adds
totalMemberCount and completedMemberCount, missing required GroupHeaderResponse
fields (totalAmount, deadline, bank, accountNumber); update the return value in
the group handler (where HttpResponse.json and dummyGroups[0] are used) to
include those fields with realistic mock values (or copy them from the existing
dummyGroups entry) so the mock conforms to GroupHeaderResponse and the header UI
no longer shows Invalid Date/undefined.
🪄 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: CHILL
Plan: Pro
Run ID: 2eedd46b-f2a7-41bb-bb0a-0350135aee66
📒 Files selected for processing (5)
src/entities/group/model/group.type.tssrc/features/settlement-details/api/useUpdatePaymentStatus.tssrc/mocks/handlers/group.tssrc/pages/expenseDetail/ExpenseDetailPage.tsxsrc/pages/expenseDetail/ui/ExpenseTimeHeader/index.tsx
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/pages/expenseDetail/ExpenseDetailPage.tsx (1)
56-57: ⚡ Quick win
currentProfile매칭 키(id)가 로더와 일치하는지:id기반 로직은 안전합니다.
MemberProfile에id: number와userId: number | null가 모두 존재하므로,undefined === undefined로 인해find가 첫 요소를 반환하는 상황은 발생하지 않습니다.- 로더는
profiles배열에서profile.userId === auth.user?.id로myProfile을 고른 뒤 그대로 반환하므로, 페이지의profiles.find((profile) => profile.id === myProfile.id)는 같은MemberProfile객체를 가리키게 됩니다.- 다만
ExpenseDetailPage에서profiles를 다시 조회하므로(중복 fetch) 단순화를 원하면loaderData의myProfile을 바로currentProfile로 사용하는 쪽을 검토할 수 있습니다.🤖 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/pages/expenseDetail/ExpenseDetailPage.tsx` around lines 56 - 57, 현재 코드가 profiles.find((profile) => profile.id === myProfile.id) ?? myProfile로 currentProfile을 결정하는데, loader에서 이미 myProfile을 결정해 반환하므로 ExpenseDetailPage 내부에서 중복 조회되는 불필요한 로직입니다; 간단히 currentProfile을 loaderData.myProfile 또는 전달된 myProfile로 직접 사용하도록 변경하여 profiles.find(...) 호출을 제거하고 관련 변수명(currentProfile, profiles, myProfile, loaderData, ExpenseDetailPage)을 찾아 해당 참조를 교체하세요.src/entities/group/api/group.ts (1)
49-53: 💤 Low value파라미터 명명의 일관성을 고려해보세요.
함수 파라미터 이름이
settlementCode이지만, 호출하는 측(useCompleteGroupSettlement)과 다른 API 함수들(getGroupHeader)에서는 모두groupToken을 사용합니다. 기능상 문제는 없지만, 일관성을 위해groupToken으로 통일하는 것을 고려해보세요.♻️ 제안하는 수정
-export const completeGroupSettlement = async ( - settlementCode: string -): Promise<void> => { - await axiosInstance.patch(`/groups/${settlementCode}/complete`); +export const completeGroupSettlement = async ( + groupToken: string +): Promise<void> => { + await axiosInstance.patch(`/groups/${groupToken}/complete`); };🤖 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/entities/group/api/group.ts` around lines 49 - 53, Rename the parameter in completeGroupSettlement from settlementCode to groupToken to match other APIs (e.g., getGroupHeader) and the caller useCompleteGroupSettlement; update the function signature export const completeGroupSettlement = async (groupToken: string): Promise<void> => { ... } and ensure the axiosInstance.patch call uses `/groups/${groupToken}/complete` so callers and other API functions remain consistent.
🤖 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/entities/group/api/group.ts`:
- Around line 49-53: Rename the parameter in completeGroupSettlement from
settlementCode to groupToken to match other APIs (e.g., getGroupHeader) and the
caller useCompleteGroupSettlement; update the function signature export const
completeGroupSettlement = async (groupToken: string): Promise<void> => { ... }
and ensure the axiosInstance.patch call uses `/groups/${groupToken}/complete` so
callers and other API functions remain consistent.
In `@src/pages/expenseDetail/ExpenseDetailPage.tsx`:
- Around line 56-57: 현재 코드가 profiles.find((profile) => profile.id ===
myProfile.id) ?? myProfile로 currentProfile을 결정하는데, loader에서 이미 myProfile을 결정해
반환하므로 ExpenseDetailPage 내부에서 중복 조회되는 불필요한 로직입니다; 간단히 currentProfile을
loaderData.myProfile 또는 전달된 myProfile로 직접 사용하도록 변경하여 profiles.find(...) 호출을 제거하고
관련 변수명(currentProfile, profiles, myProfile, loaderData, ExpenseDetailPage)을 찾아
해당 참조를 교체하세요.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 93714119-829b-4eda-9581-0f7af9043b15
📒 Files selected for processing (8)
src/entities/group/api/group.tssrc/entities/group/model/group.type.tssrc/features/payment-management/api/useCreatePaymentRequest.tssrc/features/settlement-details/api/useCompleteGroupSettlement.tssrc/mocks/handlers/group.tssrc/pages/expenseDetail/ExpenseDetailPage.tsxsrc/pages/expenseDetail/ui/BottomAction/index.tsxsrc/pages/expenseDetail/ui/ExpenseTimeHeader/index.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/pages/expenseDetail/ui/ExpenseTimeHeader/index.tsx
작업 내용
completedAt값으로 판정하도록 변경했습니다.isPaid값을 기준으로 계산합니다.PATCH /groups/{code}/complete를 연결했습니다.닫기/확인으로 보여주고,확인클릭 시 완료 PATCH를 다시 호출하지 않고 캐릭터 모달만 표시합니다.플로우
completedAt있음: 정산 완료 상태로 처리completedAt없음 + 마감 지남: 정산 실패 상태로 처리completedAt없음 + 마감 전: 진행 중 상태로 처리미완료/완료모달 표시,완료클릭 시 PATCH 호출닫기/확인모달 표시,확인클릭 시 PATCH 미호출검증
yarn build통과Summary by CodeRabbit
새로운 기능
개선 사항