Commit d427378
refactor: 타입 시스템 리팩토링 - enum을 as const 패턴으로 전환 (#110)
* feat: add Category constant with as const pattern
- Create new category.ts with CATEGORY, CATEGORY_LABEL constants
- Use as const for type inference instead of enum
- Add CATEGORY_LIST and CATEGORY_VALUES for iteration
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* refactor: standardize rank constants naming
- RANKS → RANK_LIST
- RANK_LABELS → RANK_LABEL
- Add RANK constant object for consistency
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* refactor: update constants exports and deprecate food.ts
- Export new Category and standardized Rank constants
- Add deprecation notice to food.ts (to be removed in next PR)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* refactor: restructure type files to use constants
- Remove foodCategory.ts (type now in constants)
- Update PreferredMenu → PreferredCategory
- Update OpinionForm field names (dislikedFoods → dislikedCategories)
- Import types from constants instead of separate files
BREAKING CHANGE: OpinionForm field names changed
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* refactor: update schema field names and exports
- foodCategorySchema → categorySchema
- dislikedFoodSchema → dislikedCategoriesSchema
- preferredMenusSchema → preferredCategoriesSchema
- Update opinionFormSchema with new field names
- Replace hardcoded "ANY" with CATEGORY.ANY
BREAKING CHANGE: Schema field names changed
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* refactor: rename component files to use Category naming
- FoodCard → CategoryCard
- FoodCategoryCarousel → CategoryCarousel
- DislikedFoodButton → DislikedCategoryButton
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* refactor: update component export names
- FoodCard → CategoryCard
- FoodCategoryCarousel → CategoryCarousel
- DislikedFoodButton → DislikedCategoryButton
- Update component function names to match new file names
- Internal logic unchanged (will be updated in next PR)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* refactor: update import references to use new constant names
- Update all components to use new constant names:
* RANKS → RANK_LIST
* RANK_LABELS → RANK_LABEL
* FOOD_CATEGORIES → CATEGORY_LIST
* FOOD_CATEGORY_LABEL → CATEGORY_LABEL
* FOOD_CATEGORY_VALUES → CATEGORY_VALUES
* dislikedFoodSchema → dislikedCategoriesSchema
* preferredMenusSchema → preferredCategoriesSchema
- Update type imports:
* FoodCategory → Category
- Update form field references:
* dislikedFoods → dislikedCategories
* preferredMenus → preferredCategories
- Fix component imports after file renames:
* FoodCategoryCarousel → CategoryCarousel
* DislikedFoodButton → DislikedCategoryButton
This ensures the build succeeds after type system changes.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* style: run prettier format
- Format code according to project prettier rules
- No logic changes, only formatting
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* refactor: 상수 관련 하드코딩 제거 및 deprecated 파일 삭제 (#111)
* refactor: remove hardcoded strings and rename variables in DislikedCategoryButton
- Import CATEGORY constant
- Replace hardcoded "ANY" with CATEGORY.ANY
- Rename variables:
* food → category
* dislikeFoodList → dislikedCategoryList
* dislikeFood → dislikedCategory
* filteredFoods → filteredCategories
* dislikedFoodButtonVariants → dislikedCategoryButtonVariants
- Update DislikeStep to use category prop
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* refactor: remove hardcoded strings in RankChip, RankSection, and PreferenceStep
- Import CATEGORY constant in all three files
- Replace all hardcoded "ANY" with CATEGORY.ANY
- Rename variables:
* newMenus → newCategories
* cleanedMenus → cleanedCategories
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* refactor: remove hardcoded strings in result components
VoteSummarySection.tsx:
- Import CATEGORY constant
- Replace hardcoded "ANY" with CATEGORY.ANY in category comparisons
- Replace hardcoded category strings with CATEGORY constants
- Keep distance range strings as-is (DISTANCE_RANGE values are numeric, not strings)
OtherCandidateCard.tsx:
- Update import: FOOD_CATEGORY_LABEL → CATEGORY_LABEL
- Keep "ANY" comparison for distance (not a category constant)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* chore: remove deprecated food.ts
- Delete src/constants/gathering/opinion/food.ts
- Remove deprecated exports from index.ts
- All usages migrated to category.ts
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* style: run prettier format
- Format code according to project prettier rules
- No logic changes, only formatting
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 61775b6 commit d427378
File tree
23 files changed
+279
-247
lines changed- src
- constants/gathering/opinion
- hooks/gathering
- pageComponents/gathering/opinion
- complete
- form
- result
- schemas/gathering
- types/gathering
23 files changed
+279
-247
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 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
2 | 6 | | |
3 | | - | |
| 7 | + | |
4 | 8 | | |
5 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
6 | 16 | | |
7 | 17 | | |
8 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
Lines changed: 6 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
22 | 18 | | |
23 | 19 | | |
24 | 20 | | |
| |||
85 | 81 | | |
86 | 82 | | |
87 | 83 | | |
88 | | - | |
| 84 | + | |
89 | 85 | | |
90 | 86 | | |
91 | 87 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
Lines changed: 14 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | | - | |
67 | | - | |
| 67 | + | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
Lines changed: 24 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
| 52 | + | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
58 | | - | |
| 60 | + | |
59 | 61 | | |
60 | | - | |
| 62 | + | |
61 | 63 | | |
62 | | - | |
63 | | - | |
| 64 | + | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
69 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
75 | | - | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
79 | | - | |
80 | | - | |
| 83 | + | |
| 84 | + | |
81 | 85 | | |
82 | 86 | | |
83 | | - | |
84 | | - | |
| 87 | + | |
| 88 | + | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| |||
90 | 94 | | |
91 | 95 | | |
92 | 96 | | |
93 | | - | |
| 97 | + | |
94 | 98 | | |
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
101 | | - | |
102 | | - | |
| 105 | + | |
| 106 | + | |
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
| |||
130 | 134 | | |
131 | 135 | | |
132 | 136 | | |
133 | | - | |
| 137 | + | |
134 | 138 | | |
135 | 139 | | |
136 | 140 | | |
| |||
0 commit comments