-
Notifications
You must be signed in to change notification settings - Fork 1
✨ Feat 상품 등록 관련 entity 레이어 구현 (API, Type, Constants) #196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a13f1c3
538b145
d9cf40c
81a7521
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { DeliveryCompany } from './product-delivery-company' | ||
| export { DeliveryTerms } from './product-delivery-terms' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { DISCLOSURE_FIELDS, RADIO_OPTIONS } from './product-disclosure.constant' | ||
| export type { ProductInfoNoticeKey } from './product-disclosure.constant' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { | ||
| DeliveryFormInput, | ||
| ProductDisclosureFormInput, | ||
| ProductFormInput, | ||
| ProductOptionFormInput, | ||
| ThumbnailFormInput, | ||
| } from './create-indivisual-form.type' | ||
|
|
||
| export type CreateFormType = ProductFormInput & | ||
| DeliveryFormInput & { | ||
| options: ProductOptionFormInput[] // Feature의 스키마 대신 Entity의 순수 타입을 사용 | ||
| } & ProductDisclosureFormInput & | ||
| ThumbnailFormInput | ||
|
Comment on lines
+9
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial 파일명 일관성 점검 같은 디렉터리 내에 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ export type ProductFormInput = { | |
| productionTime: string | ||
| price: number | null | ||
| discountAmount: number | null | ||
| discountType: 'won' | 'percentage' | ||
| discountType: 'AMOUNT' | 'RATE' | ||
| } | ||
|
|
||
| export type DeliveryFormInput = { | ||
|
|
@@ -16,8 +16,13 @@ export type DeliveryFormInput = { | |
| deliveryMinFee: number | null | ||
| } | ||
|
|
||
| export type ThumbnailFormInput = { | ||
| mainImage: File | null | ||
| extraImages: File[] | ||
| } | ||
|
Comment on lines
+19
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
원인: |
||
|
|
||
| export type ProductOptionFormInput = { | ||
| mainCategory: string | ||
| mainCategory: 'bread' | 'snack' | '' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Optional: 빈 문자열을 union에 포함하면 “미선택” 상태가 도메인 값처럼 취급되어 zod refine 등에서 별도 가드가 필요해집니다. |
||
| subCategory: string | ||
| optionName: string | ||
| ingredientCategories: ('glutenFree' | 'vegan')[] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { client } from '@/shared/utils/axios' | ||
|
|
||
| import { ApiResponse, StoreInfo } from './create.type' | ||
|
|
||
| // storeId 조회 | ||
| export const getMyStore = async () => { | ||
| const response = await client.get<ApiResponse<{ store: StoreInfo }>>( | ||
| '/api/v1/seller/stores', | ||
| ) | ||
| return response.data.result.store | ||
| } | ||
|
yeaseula marked this conversation as resolved.
|
||
|
|
||
| // 상품 등록 | ||
| export const createProduct = async (formData: FormData) => { | ||
| const response = await client.post('/api/v1/seller/boards', formData, { | ||
| headers: { | ||
| 'Content-Type': 'multipart/form-data', | ||
| }, | ||
| }) | ||
| return response.data | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import { queryOptions } from '@tanstack/react-query' | ||
|
|
||
| import { getMyStore } from './create.api' | ||
|
|
||
| export const productKeys = { | ||
| all: ['products'] as const, | ||
| myStore: () => [...productKeys.all, 'myStore'] as const, | ||
| } | ||
|
|
||
| export const productQueries = { | ||
| myStore: () => | ||
| queryOptions({ | ||
| queryKey: productKeys.myStore(), | ||
| queryFn: getMyStore, | ||
| }), | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,66 @@ | ||||||
| // API 요청 타입 | ||||||
| export interface CreateProductRequest { | ||||||
| storeId: number | ||||||
| title: string | ||||||
| isFresh: boolean | ||||||
| productionStartAt: string | ||||||
| price: number | ||||||
| discountType: 'AMOUNT' | 'RATE' | ||||||
| discountValue: number | ||||||
| deliveryCondition: string | ||||||
| deliveryCompany: string | ||||||
| deliveryFee: number | ||||||
| freeShippingConditions: number | ||||||
| content: string | ||||||
| products: ProductOptionRequest[] | ||||||
| productInfoNoticeRequest: Record<string, string> | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
원인: - productInfoNoticeRequest: Record<string, string>
+ productInfoNoticeRequest: Record<ProductInfoNoticeKey, string>📝 Committable suggestion
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| export interface ProductOptionRequest { | ||||||
| title: string | ||||||
| category: string | ||||||
| plusPriceWithBoardPrice: number | ||||||
| stock: number | ||||||
| dietaryTags: { | ||||||
| glutenFreeTag: boolean | ||||||
| highProteinTag: boolean | ||||||
| sugarFreeTag: boolean | ||||||
| veganTag: boolean | ||||||
| ketogenicTag: boolean | ||||||
| } | ||||||
| availability: { | ||||||
| monday: boolean | ||||||
| tuesday: boolean | ||||||
| wednesday: boolean | ||||||
| thursday: boolean | ||||||
| friday: boolean | ||||||
| saturday: boolean | ||||||
| sunday: boolean | ||||||
| } | ||||||
| nutritionInfo: { | ||||||
| totalWeight: number | ||||||
| servingSize: number | ||||||
| carbohydrates: number | ||||||
| sugars: number | ||||||
| protein: number | ||||||
| fat: number | ||||||
| calories: number | ||||||
| } | null | ||||||
| } | ||||||
|
Comment on lines
+19
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
rg -nP "sodium|servingSize|nutritionInfo" --type=ts -C2Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 6962 🏁 Script executed: rg -n "ProductOptionFormInput|servingSize" --type=tsRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 1332 🏁 Script executed: cat -n apps/seller/src/entity/products/create/create-form/create-indivisual-form.type.tsRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 1610 🏁 Script executed: rg -n "servingSize|nutritionInfo.*{" --type=ts -A5 apps/seller/src/features/products/createRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 208 🏁 Script executed: rg -n "nutritionInfo" --type=ts -B3 -A8 apps/seller/src/features/products/createRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 70 🏁 Script executed: rg -n "ProductOptionRequest" --type=ts -B5 -A10Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 2793 🏁 Script executed: rg -n "createProduct|products.*create" --type=ts -A10 apps/seller/src/entity/products/create/create-form/create.api.ts | head -50Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 344 🏁 Script executed: rg -n "new FormData|nutritionInfo|servingSize" --type=ts -B5 -A5 apps/seller/src/features/products/createRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 70 🏁 Script executed: rg -n "useCreateProductForm|handleSubmit" --type=ts -B3 -A15 | head -80Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 6233 🏁 Script executed: cat -n apps/seller/src/features/products/create/create-form/use-create-product-form.hook.tsRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 2019 🏁 Script executed: rg -n "onSubmit|createProduct\(" --type=ts -B3 -A10 apps/seller/src/features/products/create | head -100Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 70 🏁 Script executed: find apps/seller/src/features/products/create -name "*.tsx" -o -name "*.ts" | head -20Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 1812 🏁 Script executed: rg -n "CreateFormContainer|createProduct" --type=tsx -B5 -A15 apps/seller/src/pages/products/createRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 116 🏁 Script executed: rg -n "CreateFormContainer|createProduct" -B5 -A15 apps/seller/src/pages/products/createRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 4804 🏁 Script executed: rg -n "export.*CreateFormContainer" -B3 -A20 apps/seller/src/features/products/createRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 2195 🏁 Script executed: cat -n apps/seller/src/features/products/create/create-form/product-create.types.tsRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 945 🏁 Script executed: rg -n "useMutation|useCreateProductMutation|createProduct" apps/seller/src/features/products/create -B3 -A10Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 2976 영양 정보 필드 불일치 수정 필요 폼 타입 백엔드 스펙과 맞춰 양쪽 필드를 동기화하세요. (productionInfo 필드 정의 라인 40-49) |
||||||
|
|
||||||
| // API 응답 타입 | ||||||
| export interface StoreInfo { | ||||||
| storeId: number | ||||||
| name: string | ||||||
| introduce: string | ||||||
| profile: string | ||||||
| phoneNumber: string | ||||||
| email: string | ||||||
| } | ||||||
|
|
||||||
| export interface ApiResponse<T> { | ||||||
| success: boolean | ||||||
| code: number | ||||||
| message: string | ||||||
| result: T | ||||||
| } | ||||||
|
Comment on lines
+61
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial 🧩 Analysis chain🏁 Script executed: #!/bin/bash
rg -nP "interface\s+ApiResponse<|type\s+ApiResponse<" --type=tsRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 277 🏁 Script executed: #!/bin/bash
# Check the full content of both files to see the actual interface definitions
echo "=== Auth types.ts ==="
sed -n '10,20p' apps/seller/src/entity/auth/types.ts
echo -e "\n=== Create type.ts ==="
sed -n '58,70p' apps/seller/src/entity/products/create/create-form/create.type.ts
# Search for all ApiResponse definitions more broadly
echo -e "\n=== All ApiResponse definitions ==="
rg "ApiResponse" --type=ts -B 1 -A 5
# Check if `@/shared` exists
echo -e "\n=== Shared directory structure ==="
find . -path "./apps/*/src/shared" -type d 2>/dev/nullRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 4364
원인: auth와 products 도메인에서 각각 정의됨. 더욱이 |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| export type { CreateFormType } from './create-form.types' | ||
| export type { | ||
| ProductFormInput, | ||
| DeliveryFormInput, | ||
| ThumbnailFormInput, | ||
| ProductOptionFormInput, | ||
| ProductDisclosureFormInput, | ||
| } from './create-indivisual-form.type' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 파일명 오타: 원인: ♻️ 제안 diff (파일 리네임 후)-} from './create-indivisual-form.type'
+} from './create-individual-form.type' |
||
| export { getMyStore, createProduct } from './create.api' | ||
| export { productQueries, productKeys } from './create.query' | ||
| export type { | ||
| CreateProductRequest, | ||
| ProductOptionRequest, | ||
| StoreInfo, | ||
| ApiResponse, | ||
| } from './create.type' | ||
|
Comment on lines
+1
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Optional 정리 (3건 이내)
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export { CategoryOptions } from './category-options.constants' | ||
| export { EssentialOptions } from './essential-options.constants' | ||
|
Comment on lines
+1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major 상수 네이밍 컨벤션 불일치 — 코드베이스 다른 상수( ♻️ 제안-export { CategoryOptions } from './category-options.constants'
-export { EssentialOptions } from './essential-options.constants'
+export { CATEGORY_OPTIONS } from './category-options.constants'
+export { ESSENTIAL_OPTIONS } from './essential-options.constants'
export type { OptionTags } from './options-tag.type'원본 파일에서도 식별자 변경 필요합니다. |
||
| export type { OptionTags } from './options-tag.type' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { ProductDiscountType } from './product-discount-type.constants' | ||
| export { productionTimes } from './production-time.constants' |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,10 +1,10 @@ | ||||||||||||||||||||||||
| export const ProductDiscountType = [ | ||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial 상수 명명 컨벤션 제안 원인: ♻️ 제안 변경-export const ProductDiscountType = [
+export const PRODUCT_DISCOUNT_TYPES = [
{
label: '원',
value: 'AMOUNT',
},
{
label: '%',
value: 'RATE',
},
-]
+] as const📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| label: '원', | ||||||||||||||||||||||||
| value: 'won', | ||||||||||||||||||||||||
| value: 'AMOUNT', | ||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| label: '%', | ||||||||||||||||||||||||
| value: 'percentage', | ||||||||||||||||||||||||
| value: 'RATE', | ||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||
|
Comment on lines
1
to
10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
rg -nP "'won'|'percentage'" --type=ts -C2Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 4327 🏁 Script executed: # 상수 파일 확인
cat -n apps/seller/src/entity/products/create/create-info/product-discount-type.constants.ts
# 다른 파일에서의 이전 리터럴 추가 검색
rg -nP "discountType\s*[=:]\s*['\"]won['\"]|discountType\s*[=:]\s*['\"]percentage['\"]" --type=tsRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 402 🏁 Script executed: # 스키마 파일에서 enum 정의 확인
rg -nP "enum\(['\"](won|percentage|AMOUNT|RATE)" --type=ts -A2 -B2Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 70 🏁 Script executed: # 새로운 상수 값 사용 위치 확인
rg -nP "['\"]AMOUNT['\"]|['\"]RATE['\"]" --type=ts apps/seller/src/featuresRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 70 🏁 Script executed: # 완전한 impact 범위 확인 - 모든 이전 리터럴 위치
rg -nP "(won|percentage)" --type=ts apps/seller/src/features/products/create | head -50Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 1036 🏁 Script executed: # 새 상수값이 실제로 사용되는 위치 확인
rg -nP "AMOUNT|RATE" --type=ts apps/seller/src | grep -v node_modules | grep -v "\.test\." | head -30Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 524 🏁 Script executed: # ProductDiscountType 상수 사용 위치
rg -nP "ProductDiscountType" --type=ts -B2 -A2 apps/seller/src/featuresRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 1427 할인 타입 변경으로 인한 다운스트림 코드 동기화 필수 원인: 상수값은
대안: 아래 파일들을
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,7 @@ | ||
| export const productionTimes = [ | ||
| { | ||
| label: '03:00~04:00', | ||
| value: '03:00~04:00', | ||
| }, | ||
| { | ||
| label: '04:00~05:00', | ||
| value: '04:00~05:00', | ||
| }, | ||
| { | ||
| label: '05:00~06:00', | ||
| value: '05:00~06:00', | ||
| }, | ||
| { | ||
| label: '06:00~07:00', | ||
| value: '06:00~07:00', | ||
| }, | ||
| { | ||
| label: '07:00~08:00', | ||
| value: '07:00~08:00', | ||
| }, | ||
| { label: '03:00~04:00', value: '03:00' }, | ||
| { label: '04:00~05:00', value: '04:00' }, | ||
| { label: '05:00~06:00', value: '05:00' }, | ||
| { label: '06:00~07:00', value: '06:00' }, | ||
| { label: '07:00~08:00', value: '07:00' }, | ||
| ] | ||
|
Comment on lines
1
to
7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# productionTime 사용처 추적: 파싱/슬라이스/범위 가정 코드 점검
rg -nP --type=ts -C3 '\bproductionTime\b'
rg -nP --type=ts -C2 "productionTime.*(?:split|slice|substring|~)"Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 5694 🏁 Script executed: # Check API implementation for productionTime payload handling
find apps/seller/src -name "*api*" -o -name "*create*" | grep -E "(api|service)" | head -20Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 287 🏁 Script executed: # Search for where productionTime is sent to API or processed
rg -nP --type=ts "productionTime" --file-type=typescript -A5 -B2 | head -100Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 524 🏁 Script executed: # Look for any transformation/formatting of productionTime before API call
rg -nP --type=ts "(submit|send|payload|request).*productionTime|productionTime.*(submit|send|payload|request)" -A3Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 70 🏁 Script executed: # Check if there's any backend response parsing that expects range format
rg -nP --type=ts "productionTime.*range|range.*productionTime|split.*productionTime|productionTime.*split"Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 70 🏁 Script executed: cat -n apps/seller/src/entity/products/create/create-form/create.api.tsRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 777 🏁 Script executed: # Search for form submission and productionTime handling in create form
rg -nP --type=ts "createProduct|submit" apps/seller/src/features/products/create/ -A5 | head -80Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 1763 🏁 Script executed: # Look for any existing products display that might use productionTime
rg -nP --type=ts "productionTime" apps/seller/src -B2 -A2 | grep -E "(display|show|render|format)"Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 212 🏁 Script executed: # Look for product detail/display pages that might load and use productionTime
rg -nP --type=ts "productionTime" apps/seller/src/features/ -B3 -A3 | grep -E "(detail|view|display|fetch|get|load)"Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 70 🏁 Script executed: # Check if there's any product list or detail view that might show productionTime
find apps/seller/src/features -name "*detail*" -o -name "*view*" -o -name "*list*" | head -10Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 850 🏁 Script executed: # Search in the entire apps/seller for any productionTime parsing or formatting
rg -nP --type=ts "productionTime" apps/seller/src -B1 -A1 | tail -50Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 3849
라벨은 범위( |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| export { NUTRITION_FIELDS } from './product-nutritions.constant' | ||
| export type { NutritionFieldKey } from './product-nutritions.constant' | ||
| export { | ||
| MAIN_CATEGORY_OPTIONS, | ||
| SUB_CATEGORY_MAP, | ||
| } from './product-options.constant' | ||
| export { SHIPPING_DAYS } from './product-shipping-days.constant' |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,32 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export type ProductFileType = Record<string, boolean> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
필드( ✏️ 제안-export type ProductFileType = Record<string, boolean>
+export type ProductFieldType = Record<string, boolean>
...
- productFields: ProductFileType
- setProductFields: React.Dispatch<React.SetStateAction<ProductFileType>>
+ productFields: ProductFieldType
+ setProductFields: React.Dispatch<React.SetStateAction<ProductFieldType>> |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export interface NutritionData { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sugar: number | null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| protein: number | null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fat: number | null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ingredientCategories: string[] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export interface ActiveTags { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [key: string]: boolean | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export interface CreateFormHeaderType { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| productFields: ProductFileType | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| currentStep: number | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| headerHeight: number | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setProductFields: React.Dispatch<React.SetStateAction<ProductFileType>> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setCurrentStep: React.Dispatch<React.SetStateAction<number>> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setHeaderHeight: React.Dispatch<React.SetStateAction<number>> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| scrollToStep: (index: number) => void | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isScrollingToStep: React.MutableRefObject<boolean> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# 전역 React 네임스페이스 사용 가능 여부 및 동일 패턴 점검
rg -nP --type=ts -C2 'React\.MutableRefObject\b'
fd -t f 'tsconfig*.json' | xargs -I{} sh -c 'echo "==> {}"; cat "{}"' | rg -nC2 '"jsx"|"types"'Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 858 🏁 Script executed: cat package.json | grep -A5 '"react"'Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 70 🏁 Script executed: rg -n 'isScrollingToStep' --type=ts --type=tsx -B2 -A2Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 116 🏁 Script executed: rg -n 'useRef.*isScrollingToStep|isScrollingToStep.*useRef' --type=ts --type=tsx -B3 -A3Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 116 🏁 Script executed: rg -n 'const.*useRef|useRef' apps/seller/src/entity/products/create/create-store/ --type=ts --type=tsx -B1 -A1Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 116 🏁 Script executed: fd 'package.json' --type fRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 277 🏁 Script executed: rg -n 'isScrollingToStep' --type ts -B2 -A2Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 635 🏁 Script executed: fd -t f '\.(ts|js)$' apps/seller/src/entity/products/create/create-store/ | head -20Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 229 🏁 Script executed: cat apps/seller/package.json | grep -A10 -B2 '"react"'Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 491 🏁 Script executed: cat apps/seller/src/entity/products/create/create-store/index.tsRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 193 🏁 Script executed: rg -n 'CreateStoreHeaderContextValue|useRef' apps/seller/src/entity/products/create/create-store/ --type ts -B2 -A2Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 70 🏁 Script executed: rg -n 'CreateFormHeaderType|CreateStoreHeaderContextValue' apps/seller/src/ --type ts -B1 -A3Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 888 🏁 Script executed: rg -n 'useContext.*CreateStoreHeader|CreateStoreHeader.*useContext' apps/seller/src/ --type ts -B2 -A2Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 70 🏁 Script executed: fd -t f 'create-store' apps/seller/src/ | xargs ls -laRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 216 🏁 Script executed: rg -n 'CreateFormHeaderType' apps/seller/src/ --type ts -lRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 229 🏁 Script executed: rg -n 'useRef.*boolean\|scrollingToStep\|isScrolling' apps/seller/src/ --type ts -B3 -A1Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 70 🏁 Script executed: cat -n apps/seller/src/entity/products/create/create-store/create-store-header.type.tsRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 1209 🏁 Script executed: rg -n 'CreateContext\|useRef' apps/seller/src/entity/products/create/ --type ts -B2 -A3Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 70 🏁 Script executed: fd -t f 'create' apps/seller/src/entity/products/ -name '*.ts' | head -20Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 319 🌐 Web query:
💡 Result: In React 19, MutableRefObject is deprecated in favor of a unified RefObject type. All refs returned by useRef are now mutable by default (current: T, not readonly current: T | null), useRef requires an initial argument (useRef(null) or useRef(undefined) for convenience), and refs are no longer sometimes immutable. This simplifies typing and resolves previous confusion where refs initialized with null couldn't be mutated. It is not removed—it's deprecated, so still available during migration. Codemods like refobject-defaults and useRef-required-initial handle updates automatically. Official React 19 docs confirm: "MutableRef is now deprecated in favor of a single RefObject type which useRef will always return." All refs mutable by default. Citations:
🏁 Script executed: rg -rn 'CreateFormHeaderType' apps/seller/src/entity/products/create/ --type tsRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 255 🏁 Script executed: find apps/seller/src/entity/products/create -type f -name '*.ts' | head -30Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 1869 🏁 Script executed: rg -n 'isScrollingToStep' apps/seller/src/ --type ts -B5 -A5Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 1425 React 19에서 deprecated된 React 19부터 모든 ref가 mutable이 되어 MutableRefObject는 더 이상 사용되지 않습니다. ♻️ 제안- isScrollingToStep: React.MutableRefObject<boolean>
+ isScrollingToStep: React.RefObject<boolean> |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nutritionDataList: NutritionData[] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setNutritionData: (index: number, data: NutritionData) => void | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| activeTags: ActiveTags | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| productPrice: number | null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setProductPrice: React.Dispatch<React.SetStateAction<number | null>> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+19
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial
♻️ 제안+import type { Dispatch, SetStateAction, RefObject } from 'react'
+
export type ProductFileType = Record<string, boolean>
...
- setProductFields: React.Dispatch<React.SetStateAction<ProductFileType>>
- setCurrentStep: React.Dispatch<React.SetStateAction<number>>
- setHeaderHeight: React.Dispatch<React.SetStateAction<number>>
+ setProductFields: Dispatch<SetStateAction<ProductFileType>>
+ setCurrentStep: Dispatch<SetStateAction<number>>
+ setHeaderHeight: Dispatch<SetStateAction<number>>
...
- isScrollingToStep: React.MutableRefObject<boolean>
+ isScrollingToStep: RefObject<boolean>
...
- setProductPrice: React.Dispatch<React.SetStateAction<number | null>>
+ setProductPrice: Dispatch<SetStateAction<number | null>>📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| export type { | ||
| NutritionData, | ||
| ActiveTags, | ||
| CreateFormHeaderType, | ||
| } from './create-store-header.type' | ||
|
Comment on lines
+1
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
♻️ 제안 export type {
+ ProductFileType,
NutritionData,
ActiveTags,
CreateFormHeaderType,
} from './create-store-header.type' |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,11 @@ export * from './create/create-delivery/product-delivery-terms' | |
| export * from './create/create-disclosure/product-disclosure.constant' | ||
|
|
||
| // Create - Form Types | ||
| export * from './create/create-form/product-form.type' | ||
| export * from './create/create-form/create-form.types' | ||
| export * from './create/create-form/create-indivisual-form.type' | ||
| export * from './create/create-form/create.api' | ||
| export * from './create/create-form/create.query' | ||
| export * from './create/create-form/create.type' | ||
|
Comment on lines
+9
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Optional:
🧩 Analysis chain🏁 Script executed: #!/bin/bash
rg -nP "create-form/product-form\.type" --type=ts -C2Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 815 🏁 Script executed: find apps/seller/src/entity/products -type f -name "*.type.ts" | head -20Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 445 🏁 Script executed: cat -n apps/seller/src/entity/products/index.tsRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 1516 🏁 Script executed: rg "ProductOptionFormInput" apps/seller/src --type=ts -lRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 473 🏁 Script executed: rg "product-form\.type" apps/seller/src --type=tsRepository: eco-dessert-platform/dessert-front-dashboard Length of output: 278 🏁 Script executed: cat -n apps/seller/src/entity/products/create/create-form/create-indivisual-form.type.ts | head -30Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 1047 🏁 Script executed: cat -n apps/seller/src/entity/products/create/create-form/create-form.types.ts | head -30Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 550 🏁 Script executed: rg "ProductOptionFormInput" apps/seller/src/entity/products --type=ts -B2 -A2Repository: eco-dessert-platform/dessert-front-dashboard Length of output: 2108
|
||
|
|
||
| // Create - Header | ||
| export * from './create/create-header/category-options.constants' | ||
|
|
@@ -21,3 +25,6 @@ export * from './create/create-info/production-time.constants' | |
| export * from './create/create-options/product-nutritions.constant' | ||
| export * from './create/create-options/product-options.constant' | ||
| export * from './create/create-options/product-shipping-days.constant' | ||
|
|
||
| // Create - store | ||
| export * from './create/create-store/create-store-header.type' | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
storageGuide제거 — 기존 저장 데이터/응답 호환성 점검스키마가
DISCLOSURE_FIELDS기반으로 동적 생성되어 신규 폼은 정상 동작하지만, 서버 응답이나 임시 저장(draft)에productInfoNotice.storageGuide가 포함될 경우 zod에 의해 unknown 키로 떨어지거나(strict 시 실패) 사용자에게 노출되지 않습니다. 백엔드 스펙과 일치 여부, 그리고 기존 상품의 마이그레이션/표기 처리(예: 8/9번 라벨 재번호로 인한 사용자 혼선) 확인 부탁드립니다.