Skip to content

[feat] 고장 신고 관리#5

Merged
LeeSangHyeok0731 merged 19 commits into
developfrom
feat/Malfunction-report
Apr 10, 2026
Merged

[feat] 고장 신고 관리#5
LeeSangHyeok0731 merged 19 commits into
developfrom
feat/Malfunction-report

Conversation

@LeeSangHyeok0731

Copy link
Copy Markdown
Contributor

개요 💡

고장 신고 관리페이지를 제작했습니다

작업내용 ⌨️

2026-04-08.150618.mp4

@LeeSangHyeok0731 LeeSangHyeok0731 requested a review from bom0320 April 8, 2026 06:06
@LeeSangHyeok0731 LeeSangHyeok0731 self-assigned this Apr 8, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors the admin reporting and machine management systems by centralizing API configurations, implementing dynamic data fetching with React Query, and enhancing filtering capabilities. Key changes include the introduction of centralized API URL and query key constants, updated TypeScript interfaces for reports and machines, and the integration of real-time data in the admin dashboard summary. Feedback highlights several areas for improvement: ensuring filtering logic is applied to the user management page, optimizing network requests by conditionally enabling queries, addressing potential hydration mismatches with date formatting, and maintaining naming and stylistic consistency across components and types.

Comment thread src/widgets/users-page/UserPage.tsx Outdated
Comment thread src/widgets/reports-page/ReportsPage.tsx
Comment thread src/widgets/reports-page/ui/ReportsPanel.tsx
Comment thread src/shared/ui/admin/Filter/FloorGenderFilters.tsx Outdated
Comment thread src/entities/report/model/types.ts
Comment thread src/entities/machine/model/types.ts Outdated

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

수고하셨습니당

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.

SummaryCards 쪽 제가 feat/main 브랜치에서 대시보드 관련 작업을 해둔 부분이 있어서, 머지 과정에서 충돌이 발생할 가능성이 있을 것 같습니다. 특히 summary 데이터 구조나 react-query 부분이 겹칠 수 있어서,
머지 전에 한 번 맞추거나, 머지 후 정리 작업이 필요할 것 같습니다.

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.

API 연결된 건 확인했습니다. 다만 mock 데이터는 개발/에러 fallback 용도로 남겨둘지, 아니면 완전히 제거할지 기준을 맞추는 게 좋을 것 같습니다.!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fallback처리는 해놨으니 mock은 삭제하도록 하겠습니다.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

근데 일단 남겨두고 나중에 삭제할게요... 지금 mainPage에서 해당 mock데이터를 사용하고 있어서 merge되고 삭제하겠습니다.

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.

현재 타입 구조를 보면 ReportItemType이 API 응답 형태에 더 가까워 보여서, DTO와 UI 모델을 분리하는 방향으로 한 번 기준을 맞추는게 어떨까요? 저는 서버 응답은 ReportDTO로 받고, mapReport 같은 mapper에서 status 한글 변환, 시간 포맷팅, 필드명 변환을 처리한 뒤 화면에서는 ReportItem만 사용하도록 하고 있는데, 이러한 방식은 컴포넌트가 API 스펙에 직접 묶이지 않는다고 해요! 타입을 처리하는 방식을 통일하는게 좋을 것 같습니다

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

굳이 api response type이랑 컴포넌트에서 사용할 타입을 뷴리할 필요가 있을까요?
지금 보면 ReportItemType을 ReportsPanelProps에서 reports의 타입으로 사용하고, ReportResponseType으로도 사용하고 있습니다. 전자의 경우는 컴포넌트간에 전달하는 props의 것이고 후자는 api통신하는 useGetMalfunctionReports훅에서 사용하고 있습니다.
여기서 api의 스팩이 변경되면 ReportItemType를 변경하면 ReportsPanelProps와 ReportResponseType에서 전부 유효한 변경사항을 기대할 수 있습니다. 또한 원본 타입을 추적하기에도 원활하고요.
하지만 2개로 나눠 사용한다면 오히려 관리해야하는 부분이 늘어난다고 생각합니다.
그리고 status 한글 변환, 시간 포멧팅 필드명 변환을 처리한다고 하셨는데 status 한글 변환은 컴포넌트단에서 reportStatusStyleMap와 reportStatusLabelMap를 사용하여 진행하고있고, 시간 포멧팅은 일단 제 부분에서는 사용하는 곳이 없어서 모르겠습니다. 필드명 변환은 현 제 코드에서 이루어 지지 않고 있어서 필요 없을것 같습니다.

@LeeSangHyeok0731 LeeSangHyeok0731 merged commit 5781ec6 into develop Apr 10, 2026
1 check passed
@LeeSangHyeok0731 LeeSangHyeok0731 deleted the feat/Malfunction-report branch April 10, 2026 04:55
@LeeSangHyeok0731 LeeSangHyeok0731 restored the feat/Malfunction-report branch April 14, 2026 05:27
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