Skip to content

refactor: 기사기능 리팩토링 - #49

Merged
soooob43 merged 10 commits into
devfrom
refactor/mover-estimate
Aug 1, 2026
Merged

refactor: 기사기능 리팩토링#49
soooob43 merged 10 commits into
devfrom
refactor/mover-estimate

Conversation

@soooob43

@soooob43 soooob43 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

📋 작업 내용

  • 제가 맡은 기능에 대한 리팩토링 진행했습니다

🔥 변경 사항

  • 기사 견적 관련 API 호출을 axiosInstance에서 공통 fetchInstance로 전환
  • 받은 요청 조회, 견적 전송, 견적 반려, 반려 요청 조회에 공통 API 처리 방식 적용
  • API 경로를 API_ROUTES 상수 기반으로 통일
  • fetchInstance가 응답의 data를 반환하므로 중복 응답 래퍼 타입을 제거
    제거된 타입:
    MoverEstimateRequestResponse
    SendEstimateResponse
    RejectEstimateResponse
    RejectedEstimateRequestListResponse

데이터 타입은 다음과 같이 단순화했습니다.
MoverEstimateRequestResult
SentEstimate
RejectedEstimate
RejectedEstimateRequestListResult

  • 받은 요청 페이지에 h1 제목 추가
  • 모바일·태블릿·데스크톱별 제목 높이와 좌우 여백 적용
  • 기사 보낸 견적 상세 페이지에서 견적서 공유하기 영역 제거
  • 상세페이지에 기사님 코멘트 추가

✅ 체크리스트

  • 로컬에서 정상 동작을 확인했습니다.
  • 기존 기능에 영향을 주지 않는지 확인했습니다.
  • 불필요한 console.log를 제거했습니다.
  • lint를 통과했습니다.
  • README 또는 문서를 수정했습니다. (필요 시)
  • API 명세와 일치하는지 확인했습니다.

📷 스크린샷 (선택)

image

🔗 관련 이슈

Closes #


💬 To Reviewer

  • 계속 리팩토링 진행 중에 있습니다! 추가로 발견되는 문제는 따로 PR 올리겠습니다

Summary by CodeRabbit

  • 새 기능

    • ‘받은 요청’ 페이지에 화면 크기에 맞춰 표시되는 제목 헤더가 추가되었습니다.
    • 보낸 견적 카드의 날짜가 ‘YYYY년 MM월 DD일’ 형식으로 표시됩니다.
    • 보낸 견적 상세 페이지에서 기사님 코멘트를 확인할 수 있습니다.
  • 개선

    • 다양한 화면 크기에서 견적 목록과 카드가 더 안정적으로 표시됩니다.
    • 보낸 견적 상세 페이지의 요청 정보와 코멘트 구성이 개선되었습니다.
    • 견적 공유 기능이 제거되었습니다.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

견적 요청 API가 fetchInstance와 공통 API 훅을 사용하도록 변경되었습니다. 응답 타입이 성공 데이터 중심으로 단순화되었습니다. 보낸 견적 화면의 날짜 형식과 반응형 기준이 조정되었습니다. 받은 요청 헤더와 기사님 코멘트가 추가되었고, 상세 페이지 공유 UI가 제거되었습니다.

Changes

견적 요청 기능

Layer / File(s) Summary
API 계약 및 공통 훅 전환
src/types/moverEstimateRequest.ts, src/lib/api/moverEstimateRequests.ts, src/hooks/useMoverEstimateRequests.ts
응답 유니온 타입을 결과 타입으로 교체했습니다. API 호출을 axiosInstance에서 fetchInstance로 변경했습니다. 조회와 mutation에 공통 API 훅을 적용했습니다.
보낸 견적 표시 조정
src/components/estimate/sent/SentEstimateCard.tsx, src/components/estimate/sent/SentEstimatesPage.tsx
이사일을 YYYY년 MM월 DD일 형식으로 표시합니다. 반응형 기준을 min-[744px]min-[1344px]로 변경했습니다. 목록과 카드에 min-w-0를 적용했습니다.
견적 페이지 레이아웃 조정
src/components/estimate/ReceivedRequestsPage.tsx, src/components/estimate/sent/SentEstimateDetailPage.tsx
받은 요청 페이지에 “받은 요청” 헤더를 추가했습니다. 보낸 견적 상세 페이지에 기사님 코멘트를 추가하고 EstimateDetailShare 렌더링을 제거했습니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: yooseohyeon, juengseulki

🚥 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
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 기사 기능 리팩토링이라는 PR의 주요 변경과 관련됩니다. 다만 견적 API 리팩토링과 UI 변경을 구체적으로 설명하지는 않습니다.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/mover-estimate

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.

🧹 Nitpick comments (2)
src/types/moverEstimateRequest.ts (1)

31-38: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

공개 결과 타입을 interface로 변경하세요.

MoverEstimateRequestResultRejectedEstimateRequestListResult는 객체 형태의 공개 타입입니다. 프로젝트 규칙에 맞게 interface를 사용하세요.

변경 예시
-export type MoverEstimateRequestResult = {
+export interface MoverEstimateRequestResult {
   items: MoverEstimateRequest[];
   pagination: {
     nextCursor: string | null;
     hasNextPage: boolean;
     totalCount: number;
   };
-};
+}

-export type RejectedEstimateRequestListResult = {
+export interface RejectedEstimateRequestListResult {
   items: RejectedEstimateRequestItem[];
   pagination: {
     nextCursor: string | null;
     hasNextPage: boolean;
   };
-};
+}

As per coding guidelines, interface를 우선 사용합니다.

Also applies to: 91-97

🤖 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/types/moverEstimateRequest.ts` around lines 31 - 38,
MoverEstimateRequestResult와 RejectedEstimateRequestListResult의 객체형 공개 타입 선언을
type에서 interface로 변경하세요. 기존 필드와 중첩된 pagination 구조는 그대로 유지하고, 다른 타입이나 동작은 수정하지
마세요.

Sources: Coding guidelines, Path instructions

src/components/estimate/sent/SentEstimatesPage.tsx (1)

37-37: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

새 레이아웃에서 공통 디자인 토큰과 typography 컴포넌트를 사용하세요.

두 위치가 페이지 크기와 여백을 직접 선언합니다. 공통 chrome 값이 바뀌면 화면 간 간격이 달라질 수 있습니다.

  • src/components/estimate/sent/SentEstimatesPage.tsx#L37-L37: raw min-h 계산과 padding 값을 기존 페이지 헤더 및 반응형 여백 토큰으로 교체하세요.
  • src/components/estimate/ReceivedRequestsPage.tsx#L105-L109: raw 헤더 크기와 여백을 토큰으로 교체하고, 제목은 Text as="h1"의 variant로 표시하세요.

As per coding guidelines, Use the project's existing design tokens ... instead of hardcoding design values.

🤖 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/components/estimate/sent/SentEstimatesPage.tsx` at line 37, Update
src/components/estimate/sent/SentEstimatesPage.tsx lines 37-37 to replace the
hardcoded min-h calculations and padding values with the existing page-header
and responsive spacing design tokens. Update
src/components/estimate/ReceivedRequestsPage.tsx lines 105-109 to use shared
tokens for header sizing and spacing, and render the page title through the Text
component with the appropriate h1 variant.

Sources: Coding guidelines, Path instructions

🤖 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/components/estimate/sent/SentEstimatesPage.tsx`:
- Line 37: Update src/components/estimate/sent/SentEstimatesPage.tsx lines 37-37
to replace the hardcoded min-h calculations and padding values with the existing
page-header and responsive spacing design tokens. Update
src/components/estimate/ReceivedRequestsPage.tsx lines 105-109 to use shared
tokens for header sizing and spacing, and render the page title through the Text
component with the appropriate h1 variant.

In `@src/types/moverEstimateRequest.ts`:
- Around line 31-38: MoverEstimateRequestResult와
RejectedEstimateRequestListResult의 객체형 공개 타입 선언을 type에서 interface로 변경하세요. 기존 필드와
중첩된 pagination 구조는 그대로 유지하고, 다른 타입이나 동작은 수정하지 마세요.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 45b191cc-e7db-49a9-98d6-ccc6bf8a1151

📥 Commits

Reviewing files that changed from the base of the PR and between d631b02 and 6b9326c.

📒 Files selected for processing (7)
  • src/components/estimate/ReceivedRequestsPage.tsx
  • src/components/estimate/sent/SentEstimateCard.tsx
  • src/components/estimate/sent/SentEstimateDetailPage.tsx
  • src/components/estimate/sent/SentEstimatesPage.tsx
  • src/hooks/useMoverEstimateRequests.ts
  • src/lib/api/moverEstimateRequests.ts
  • src/types/moverEstimateRequest.ts
💤 Files with no reviewable changes (1)
  • src/components/estimate/sent/SentEstimateDetailPage.tsx

@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/components/estimate/sent/SentEstimateDetailPage.tsx (1)

72-72: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

새 컴포넌트의 Props 타입을 interface로 분리해 주세요.

Line 72의 SentEstimateComment는 inline object type을 사용합니다. SentEstimateCommentProps interface를 선언하고 함수 시그니처에 적용하세요.

제안하는 수정
+interface SentEstimateCommentProps {
+  comment: string;
+}
+
-function SentEstimateComment({ comment }: { comment: string }) {
+function SentEstimateComment({ comment }: SentEstimateCommentProps) {

As per path instructions, src/components/**/*.tsx의 Props는 interface XxxProps 형태로 정의해야 합니다.

🤖 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/components/estimate/sent/SentEstimateDetailPage.tsx` at line 72,
SentEstimateComment의 inline props 객체 타입을 제거하고, SentEstimateCommentProps
interface를 선언해 함수 시그니처에 적용하세요. 기존 comment 필드의 타입과 동작은 그대로 유지하고, 컴포넌트 Props는
interface XxxProps 규칙을 따르도록 변경하세요.

Source: Path instructions

🤖 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/components/estimate/sent/SentEstimateDetailPage.tsx`:
- Line 72: SentEstimateComment의 inline props 객체 타입을 제거하고,
SentEstimateCommentProps interface를 선언해 함수 시그니처에 적용하세요. 기존 comment 필드의 타입과 동작은
그대로 유지하고, 컴포넌트 Props는 interface XxxProps 규칙을 따르도록 변경하세요.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a847f86a-d143-486f-bf33-fdf70d8abb43

📥 Commits

Reviewing files that changed from the base of the PR and between 6b9326c and 12bf511.

📒 Files selected for processing (1)
  • src/components/estimate/sent/SentEstimateDetailPage.tsx

@soooob43 soooob43 changed the title refactor: refactor: 기사기능 리팩토링 Aug 1, 2026

@juengseulki juengseulki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📋 PR 리뷰

👍 좋았던 점

  • 기사 견적 관련 API를 axiosInstance에서 공통 fetchInstance로 통일한 점
  • fetchInstancedata만 반환하는 구조에 맞춰 Response Wrapper 타입을 제거하고 실제 사용하는 Result 타입만 남긴 점
  • API 경로를 문자열이 아닌 API_ROUTES 상수 기반으로 정리한 점
  • 받은 요청 페이지에 시안에 맞는 제목을 추가하고 반응형 여백까지 함께 적용한 점
  • 기사 보낸 견적 상세 페이지에서 현재 사용하지 않는 공유 영역을 제거하고 기사님 코멘트를 추가한 점

리팩토링 범위가 여러 파일에 걸쳐 있었지만, API 호출 방식과 타입 구조를 함께 정리해서 이후 유지보수하기도 훨씬 편해질 것 같습니다.

🔍 확인 및 제안

인라인 코멘트로 아래 내용을 남겼습니다.

  • fetchInstance로 전환하면서 응답 Wrapper 타입을 제거한 방향은 좋았습니다.
  • 아직 프로젝트에 남아 있는 axiosInstance 사용 API들도 동일한 방향으로 순차적으로 통일할 계획인지 궁금합니다. API 호출 방식이 하나로 통일되면 응답 타입과 에러 처리도 함께 일관성 있게 관리할 수 있을 것 같습니다.

전체적으로 기능 변경 없이 코드 구조를 단순화하고 일관성을 높인 리팩토링이라고 생각했습니다. 수고하셨습니다! 😊

Comment thread src/lib/api/moverEstimateRequests.ts
@soooob43
soooob43 merged commit bcd7de9 into dev Aug 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants