Skip to content

refactor: 정산 뷰 수정#62

Merged
KEEKE132 merged 12 commits into
feat/28-Budget_viewfrom
refactor/56-settlement-integration
May 20, 2025
Merged

refactor: 정산 뷰 수정#62
KEEKE132 merged 12 commits into
feat/28-Budget_viewfrom
refactor/56-settlement-integration

Conversation

@KEEKE132

Copy link
Copy Markdown
Collaborator

#️⃣연관된 이슈 번호

#56

📝작업 내용

  • API 호출과 관련된 오류 수정
  • teamId 에 Recoil 적용

🧪 테스트 여부

  • 테스트 코드를 작성함
  • 테스트를 수행함

💬리뷰 요구사항

  • 리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요
  • ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

@KEEKE132 KEEKE132 self-assigned this May 20, 2025
@KEEKE132 KEEKE132 requested a review from Copilot May 20, 2025 03:10

Copilot AI 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.

Pull Request Overview

This PR refactors the settlement view by updating API calls, standardizing team ID usage with Recoil and route params, and adjusting UI components to use nickname-based user data.

  • Updates API update methods from PUT to PATCH for consistency.
  • Incorporates teamId from Recoil and URL parameters in settlement pages.
  • Refactors component renderings such as UserProfile and settlement links, and renames toggling methods in the backend.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Frontend/luckeyseven/src/service/settlementService.js Updated updateSettlement to use PATCH and include an empty data object for settledOnly operations.
Frontend/luckeyseven/src/pages/Settlement/TeamSettlementsPage.jsx Adjusted teamId logic to combine Recoil and URL params; updated data fetching using API response meta.
Frontend/luckeyseven/src/pages/Settlement/SettlementNewPage.jsx Updated teamId assignment using Recoil and useParams.
Frontend/luckeyseven/src/pages/Settlement/SettlementEditPage.jsx Standardized teamId usage via Recoil and URL params.
Frontend/luckeyseven/src/pages/Settlement/SettlementDetailPage.jsx Modified routing for edit navigation and added debug log (console.info).
Frontend/luckeyseven/src/components/settlement/settlement-list.jsx Updated settlement display to use nickname fields and reformatted link component; review link path consistency.
Frontend/luckeyseven/src/components/settlement/settlement-form.jsx Adjusted initial form data assignment and updated field rendering to use nickname/description values.
Frontend/luckeyseven/src/components/settlement/settlement-filter.jsx Removed unused teamId prop and updated option labels with nickname/description.
Frontend/luckeyseven/src/components/settlement/settlement-detail.jsx Updated displayed expense descriptions and applied teamId in edit navigation.
Frontend/luckeyseven/src/components/common/UserProfile.jsx Changed component to use nickname instead of full user object for display.
Frontend/luckeyseven/src/components/common/SettlementActions.jsx Updated API call parameters and formatting; preserved toggle behavior for settlement status.
Frontend/luckeyseven/src/App.jsx Adjusted settlement route paths to include teamId for new and edit pages.
Backend/* Renamed methods and updated toggling of settlement status, with corresponding test updates and mapper adjustments.
Comments suppressed due to low confidence (3)

Frontend/luckeyseven/src/service/settlementService.js:49

  • Ensure the backend supports using PATCH for both partial and full updates after replacing PUT. Update API documentation if necessary.
const response = await privateApi.patch(`/api/settlements/${id}`, {}, {params: {settledOnly: true}});

Frontend/luckeyseven/src/pages/Settlement/SettlementDetailPage.jsx:21

  • [nitpick] Consider removing or reducing debug logging before production deployment.
console.info("팀아이디", settlement.teamId)

Backend/src/main/java/com/luckyseven/backend/domain/settlements/entity/Settlement.java:83

  • Toggling the settled status with 'convertSettled' might lead to unintended behavior if the current state is not as expected. Consider using explicit methods to set the status to true or false.
public void convertSettled() { this.isSettled = !this.isSettled; }

</div>
<div className="space-y-4">
{settlements.map((settlement) => (
<Link to={`/settlements/${settlement.id}`} key={settlement.id}

Copilot AI May 20, 2025

Copy link

Choose a reason for hiding this comment

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

The route path for settlement details may need to include the teamId parameter for consistency with the updated routes. Verify and update the Link path if required.

Copilot uses AI. Check for mistakes.
) : (
<div
className="w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center">
{nickname.charAt(0) || "?"}

Copilot AI May 20, 2025

Copy link

Choose a reason for hiding this comment

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

Ensure 'nickname' is defined before calling charAt(0) in the fallback rendering to avoid potential runtime errors. Use a conditional check or default value.

Suggested change
{nickname.charAt(0) || "?"}
{nickname && typeof nickname === "string" ? nickname.charAt(0) : "?"}

Copilot uses AI. Check for mistakes.
@KEEKE132 KEEKE132 merged commit bc5287c into feat/28-Budget_view May 20, 2025
1 check passed
@KEEKE132 KEEKE132 deleted the refactor/56-settlement-integration branch May 20, 2025 03:11
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.

2 participants