Skip to content

[Refactor] core entity structure and admin query flow#10

Merged
bom0320 merged 18 commits into
developfrom
refactor/core
Apr 27, 2026
Merged

[Refactor] core entity structure and admin query flow#10
bom0320 merged 18 commits into
developfrom
refactor/core

Conversation

@bom0320

@bom0320 bom0320 commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

개요 💡

admin 영역 전반의 core 구조를 리팩토링했습니다.
machine / reservation / user / dashboard entity의 export 구조를 정리하고, query key / invalidate 흐름을 통일했으며, machine 관리 UI와 reservation 관련 로직의 중복을 줄이는 방향으로 구조를 개선했습니다.

작업내용 ⌨️

  • machine / reservation / user / dashboard entity에 barrel export(index.ts, api/index.ts) 구조 적용했음
  • reservation & machine 의 type의 중복을 해결함
  • machine / reservation mapper 정리하고 중복되던 상태/표시 로직 shared util로 분리했음
  • MachineStatusBadge 단순화하고 상태 해석 책임을 mapper로 이동했음
  • MachineStatusModal 내부 UI 하위 컴포넌트로 분리했음
  • getMachineReservationInfo 반환값 정리하고 불필요한 값 제거했음
  • reservation delete mutation을 entity api 기준으로 이동해서 구조 통일했음
  • queryKeysall prefix 추가하고 invalidate 전략 통일했음
  • biome 적용해서 formatting 및 lint 수정하고 query key 타입 개선했음

추가 참고 사항 📌

이번 리팩토링에서 API / 데이터 처리 기준을 다음과 같이 정리했습니다.

  • API 레이어는 데이터 fetching만 담당하도록 통일했음
  • 서버 응답은 가능한 Raw 형태 그대로 사용하도록 유지했음
  • UI 요구사항이 있는 경우에만 mapper를 통해 가공하도록 분리했음
  • queryKeys를 중앙에서 관리하고 all prefix를 추가해서invalidate 전략을 일관되게 맞췄음
  • API 호출 흐름을 Component → useQuery → API 함수 → axios 구조로 통일했음

@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 entity and widget layers to centralize mapping logic, simplify component props, and improve code organization through barrel exports. Key updates include the introduction of shared utility functions for date formatting and status mapping, alongside a reorganization of API hooks and query keys. A regression was noted in the MachineStatusPanel where the real-time countdown timer for machine usage was removed, resulting in static time displays that only update upon refetching.

Comment thread src/widgets/machines-page/ui/MachineStatusPanel.tsx

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

문제 없는것같습니다. 수고하셨습니다!

@bom0320 bom0320 merged commit f877ae1 into develop Apr 27, 2026
1 check passed
@bom0320 bom0320 deleted the refactor/core branch April 27, 2026 03:22
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