Commit b5b194f
feat: 의견 수렴 페이지에 쓰일 Query Hooks 생성 (#53)
* feat: gathering domain hooks 추가
- useGetGathering: 모임 조회 hook
- useGetGatheringCapacity: 모임 참여자 현황 조회 hook
- Domain별로 hooks 구조화 (폴더별 분리 제거)
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* feat: participant domain hooks 추가
- useCreateParticipant: 모임 참여 mutation hook
- participant를 독립 domain으로 분리
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* feat: recommend-result domain hooks 추가
- useGetRecommendResult: 추천 결과 조회 hook
- recommend-result를 독립 domain으로 분리
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* refactor: hooks index 파일 업데이트
- gathering, participant, recommend-result domain별 export
- Domain 기반 hooks 구조 완성
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* feat: useGetGatheringCapacity에 10초 refetch 추가
- refetchInterval: 1000 * 10 설정
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* feat: useQuery Hook 기반의 함수 내 select 옵션 일괄 추가하여 데이터 정제
* feat: 의견 수렴 페이지 전체 API 연동 및 서버 Prefetch 적용 (#54)
* refactor: IntroStep scheduledDate prop 연동
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* refactor: DistanceStep API 기반 region prop 연동
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* refactor: PreferenceStepFooter onSubmit prop 변경
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* refactor: CompleteView 텍스트 인라인 처리
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* refactor: SubmissionBottomSheet props명 변경 (maxCount, currentCount)
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* feat: useOpinionForm에 createParticipant 제출 로직 연동
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* feat: 의견 수렴 페이지 API 연동 및 타입 수정
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* feat: queryOption에 select 추가하여 response.data 자동 추출
- gathering detail, capacity에 select 추가
- 클라이언트 코드에서 .data 접근 불필요
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* feat: 의견 수렴 페이지에 서버 프리페치 적용
- page.tsx를 서버 컴포넌트로 변경
- OpinionView.tsx로 클라이언트 로직 분리
- HydrationBoundary로 gathering 데이터 prefetch
- 무한 렌더링 문제 해결
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* fix: useCreateParticipant Hook 을 Import 하는 경로를 올바르게 수정'
* feat: PendingView, CompleteView에 HydrationBoundary 및 API 연동 추가
- pending/page.tsx, complete/page.tsx를 서버 컴포넌트로 변경
- PendingView.tsx, CompleteView.tsx 클라이언트 컴포넌트 분리
- useGetGatheringCapacity hook으로 실시간 참여자 현황 조회
- HydrationBoundary로 capacity 데이터 prefetch
- 하드코딩된 maxCount, currentCount 제거
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* feat: ResultView에 HydrationBoundary 및 API 연동 추가
- result/page.tsx를 서버 컴포넌트로 변경
- ResultView.tsx 클라이언트 컴포넌트 분리
- useGetRecommendResult, useGetGatheringCapacity hook으로 데이터 조회
- HydrationBoundary로 capacity, recommend-result 데이터 prefetch
- MOCK_RECOMMENDATION_RESULT 제거
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* feat: 식당 페이지 이동 과정에서 Cursor Pointer 스타일 적용
* feat: distanceRange를 실제 거리 값으로 변환하는 로직 추가
- DISTANCE_RANGE_VALUES 상수 추가 (각 범위를 km 값으로 매핑)
- RANGE_500M: 0.5km
- RANGE_1KM: 1km
- ANY: null
- useOpinionForm에서 하드코딩된 0.5 제거
- distanceRange를 DISTANCE_RANGE_VALUES로 변환하여 API 전송
- CreateParticipantRequest의 distance 타입을 number | null로 변경
리뷰 가이드:
- PR 6에서 DISTANCE_RANGE enum 구조로 더욱 개선 예정
- 현재는 기본적인 매핑 로직만 추가하여 하드코딩 제거
* refactor: Zod 기반 런타임 검증 추가 및 Controller 패턴에서 useController 패턴으로 마이그레이션 (#55)
* feat: Opinion Form에 Zod schema 및 validation 추가
- opinionFormSchema 정의 (distanceRange, dislikedFoods, preferredMenus)
- preferredMenus에 대한 복잡한 검증 로직 (superRefine)
- distanceRangeToKm 헬퍼 함수 추가
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* feat: useOpinionForm에 zodResolver 적용 및 distance 변환 수정
- zodResolver 추가로 런타임 검증 활성화
- distanceRange → distance 변환 로직 수정 (하드코딩 제거)
- useDislikeStep, usePreferenceStep export 제거 (미사용)
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* refactor: PreferenceStep을 useController 기반 RankChip 패턴으로 리팩토링
- RankChip 컴포넌트 생성 (useController로 자체 상태 관리)
- Controller 제거, 비즈니스 로직을 RankChip으로 이동
- 선택 해제 기능 제거 (다른 항목 선택으로만 변경 가능)
- RankSection을 RankChip 사용하도록 수정
- PreferenceStep을 선언적 컴포넌트로 단순화
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* refactor: DislikeStep을 useController 기반 DislikedFoodButton 패턴으로 리팩토링
- DislikedFoodButton 컴포넌트 생성 (useController로 자체 상태 관리)
- Controller 제거, 비즈니스 로직을 DislikedFoodButton으로 이동
- 선택 해제 기능 제거 (다른 항목 선택으로만 변경 가능)
- DislikeStep을 선언적 컴포넌트로 단순화
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* refactor: DistanceStep 컴포넌트 분리 및 개선
- DistanceSelector 컴포넌트 분리 (선택 UI 담당)
- 선택 해제 기능 제거 (다른 거리 선택으로만 변경 가능)
- REGION_OPTIONS 접근 방식 수정 (.value → .id)
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* refactor: OpinionView를 form 태그로 감싸고 onSubmit으로 제출 처리
- form 태그 추가 및 onSubmit 이벤트 핸들러로 변경
- 엔터 키로 제출 가능하도록 개선
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* feat: PreferredMenu 타입 추가 및 OpinionForm에 적용
- PreferredMenu 타입을 Partial<Record<RankKey, FoodCategory>>로 정의
- OpinionForm의 preferredMenus 필드에 PreferredMenu 타입 적용
- 타입 안정성 강화
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* fix: preferredMenus 내 Zod Schema 옵션을 간소화 하여 복잡도 감소
* chore: prettier 포맷에 맞지 않았던 코드 수정
* feat: zod 및 @hookform/resolvers 라이브러리 설치
* refactor: Opinion Form 컴포넌트 구조 개선 및 상수 리팩토링 (#56)
* feat: DislikeStep 및 PreferenceStep용 custom hooks 추가
- useDislikeStep: 단일 선택 로직 및 검증
- usePreferenceStep: rank별 선택, 중복 체크, 검증 로직
- hooks/gathering/index.ts에 export 추가
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* refactor: DistanceStep 개선 및 DistanceSelector 분리
- DistanceSelector를 별도 파일로 분리
- useWatch compute로 validation 간소화
- Chip 그룹 로직을 컴포넌트로 캡슐화
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* refactor: OpinionForm 타입을 OpinionFormSchema로 마이그레이션
- Zod inferred type 사용으로 타입 안정성 강화
- PreferredMenu를 Partial 타입으로 변경
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* refactor: VoteSummarySection을 ResultView에 통합
- VoteSummarySection 컴포넌트 제거
- votes 렌더링 로직을 ResultView로 이동
- VoteList 분리로 관심사 분리
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* refactor: FoodCard를 FoodCategoryCarousel에 inline 통합
- FoodCard 타입 개선
- 상수 import 경로 변경
- CompleteView 공백 정리
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* refactor: restaurantCard를 pageComponents/gathering으로 이동
- src/components/restaurantCard → src/pageComponents/gathering/restaurantCard
- 도메인별 컴포넌트 구조 정리
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* refactor: Enum 구조를 일관되게 재설계
- DISTANCE_RANGE, DISTANCE_RANGE_LABEL enum 추가
- FOOD_CATEGORY_LABEL enum 추가
- REGION, REGION_LABEL enum 추가
- Single Source of Truth 패턴 적용
- 모든 enum은 UPPER_CASE 네이밍 사용
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* refactor: recommend-result 폴더명을 recommendResult로 변경
- kebab-case → camelCase 통일
- src/apis/recommend-result → src/apis/recommendResult
- src/hooks/apis/recommend-result → src/hooks/apis/recommendResult
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* refactor: RegionChip 컴포넌트 분리 및 useController 적용
- RegionChip: 단일 Chip 렌더링, useController 패턴
- RegionStep: REGION_OPTIONS map하여 RegionChip 사용
- 선택 로직을 컴포넌트 내부로 캡슐화
Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* fix: 병합 충돌 과정에서 발생한 Typescript 이슈 수정
* chore: prettier 포맷에 맞지 않았던 코드 수정
* fix: 이미 제거되었던 Hook 이 작업 이력에 남았던 문제 수정
* feat: 공덕역 항목을 Region 상수에 추가
* fix: Document 제거
* fix: gathering domain 내 타입 정의 모듈의 위치를 수정
---------
Co-authored-by: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* fix: 코드 베이스 상 수정이 필요한 부분 반영
* fix: es-toolkit 을 활용하여 일부 로직 구문 최적화 수행
---------
Co-authored-by: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
---------
Co-authored-by: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
* fix: 더 이상 사용하지 않는 Type 모듈 제거
---------
Co-authored-by: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>1 parent d33706f commit b5b194f
File tree
66 files changed
+1213
-911
lines changed- app/gathering/[accessKey]/opinion
- complete
- pending
- result
- src
- apis
- gathering
- participant
- recommendResult
- components/chip
- constants/gathering/opinion
- hooks
- apis
- gathering
- participant
- recommendResult
- gathering
- pageComponents/gathering
- create
- opinion
- restaurantCard
- schemas/gathering
- types/gathering
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
66 files changed
+1213
-911
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | 1 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
20 | 15 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 26 | + | |
28 | 27 | | |
29 | 28 | | |
30 | | - | |
| 29 | + | |
31 | 30 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 31 | + | |
50 | 32 | | |
51 | 33 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | 1 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
77 | 15 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
90 | 23 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 24 | + | |
| 25 | + | |
103 | 26 | | |
104 | 27 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
117 | 31 | | |
118 | 32 | | |
0 commit comments