refactor: 기사기능 리팩토링 - #49
Conversation
…into refactor/mover-estimate
…into refactor/mover-estimate
📝 WalkthroughWalkthrough견적 요청 API가 Changes견적 요청 기능
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/types/moverEstimateRequest.ts (1)
31-38: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win공개 결과 타입을
interface로 변경하세요.
MoverEstimateRequestResult와RejectedEstimateRequestListResult는 객체 형태의 공개 타입입니다. 프로젝트 규칙에 맞게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: rawmin-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
📒 Files selected for processing (7)
src/components/estimate/ReceivedRequestsPage.tsxsrc/components/estimate/sent/SentEstimateCard.tsxsrc/components/estimate/sent/SentEstimateDetailPage.tsxsrc/components/estimate/sent/SentEstimatesPage.tsxsrc/hooks/useMoverEstimateRequests.tssrc/lib/api/moverEstimateRequests.tssrc/types/moverEstimateRequest.ts
💤 Files with no reviewable changes (1)
- src/components/estimate/sent/SentEstimateDetailPage.tsx
There was a problem hiding this comment.
🧹 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을 사용합니다.SentEstimateCommentPropsinterface를 선언하고 함수 시그니처에 적용하세요.제안하는 수정
+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
📒 Files selected for processing (1)
src/components/estimate/sent/SentEstimateDetailPage.tsx
juengseulki
left a comment
There was a problem hiding this comment.
📋 PR 리뷰
👍 좋았던 점
- 기사 견적 관련 API를
axiosInstance에서 공통fetchInstance로 통일한 점 fetchInstance가data만 반환하는 구조에 맞춰 Response Wrapper 타입을 제거하고 실제 사용하는 Result 타입만 남긴 점- API 경로를 문자열이 아닌
API_ROUTES상수 기반으로 정리한 점 - 받은 요청 페이지에 시안에 맞는 제목을 추가하고 반응형 여백까지 함께 적용한 점
- 기사 보낸 견적 상세 페이지에서 현재 사용하지 않는 공유 영역을 제거하고 기사님 코멘트를 추가한 점
리팩토링 범위가 여러 파일에 걸쳐 있었지만, API 호출 방식과 타입 구조를 함께 정리해서 이후 유지보수하기도 훨씬 편해질 것 같습니다.
🔍 확인 및 제안
인라인 코멘트로 아래 내용을 남겼습니다.
fetchInstance로 전환하면서 응답 Wrapper 타입을 제거한 방향은 좋았습니다.- 아직 프로젝트에 남아 있는
axiosInstance사용 API들도 동일한 방향으로 순차적으로 통일할 계획인지 궁금합니다. API 호출 방식이 하나로 통일되면 응답 타입과 에러 처리도 함께 일관성 있게 관리할 수 있을 것 같습니다.
전체적으로 기능 변경 없이 코드 구조를 단순화하고 일관성을 높인 리팩토링이라고 생각했습니다. 수고하셨습니다! 😊
📋 작업 내용
🔥 변경 사항
제거된 타입:
MoverEstimateRequestResponse
SendEstimateResponse
RejectEstimateResponse
RejectedEstimateRequestListResponse
데이터 타입은 다음과 같이 단순화했습니다.
MoverEstimateRequestResult
SentEstimate
RejectedEstimate
RejectedEstimateRequestListResult
✅ 체크리스트
📷 스크린샷 (선택)
🔗 관련 이슈
Closes #
💬 To Reviewer
Summary by CodeRabbit
새 기능
개선