feat(admin): suggest and merge sibling origin goods in config modal

This commit is contained in:
yeuimu
2026-08-27 18:40:13 +08:00
parent 697b82a64b
commit 0aa6cbf1d9
4 changed files with 918 additions and 798 deletions
+137 -124
View File
@@ -24,7 +24,7 @@ export interface User {
}
// Good types
export interface Good {
export interface Good {
id: string
goodName: string
goodImage: string | null
@@ -42,81 +42,92 @@ export interface Good {
position?: Position
createdAt: string
updatedAt: string
}
export interface OriginGoodDetail {
productCode?: string | null
englishName?: string | null
productionCycleHours?: number | null
minWeightG?: string | null
productionProcess?: string | null
materialDescription?: string | null
sizeChart?: { columns?: Array<{ key: string; name: string }>; rows?: any[] } | null
packageSpecs?: { rows?: any[] } | null
syncedAt?: string | null
[key: string]: unknown
}
export interface OriginGoodVariant {
sdsVariantId: string
sku: string
sizeName?: string | null
colorName?: string | null
colorHex?: string | null
price?: string | null
enabled: boolean
[key: string]: unknown
}
export interface CustomGoodVariantRequest {
sku: string
sizeId?: string | null
sizeName?: string | null
colorId?: string | null
colorName?: string | null
colorHex?: string | null
imageUrl?: string | null
price?: string | null
originalPrice?: string | null
weightG?: string | null
boxLengthCm?: string | null
boxWidthCm?: string | null
boxHeightCm?: string | null
designData?: Record<string, unknown> | null
enabled?: boolean
sortOrder?: number
}
export interface CustomGoodDetailRequest {
productCode?: string | null
englishName?: string | null
productionCycleHours?: number | null
minWeightG?: string | null
productionProcess?: string | null
materialDescription?: string | null
blankDesignUrl?: string | null
detailsPageVideoUrl?: string | null
textureName?: string | null
reminder?: string | null
productPerformance?: string | null
applicableScenarios?: string | null
washingInstructions?: string | null
specialDescription?: string | null
designExplanation?: string | null
designArea?: string | null
pictureRequest?: string | null
sizeChart?: Record<string, unknown> | null
packageSpecs?: Record<string, unknown> | null
options?: Record<string, unknown> | null
media?: Record<string, unknown> | null
}
export interface GoodDetail extends Good {
originDetail: OriginGoodDetail | null
variants: OriginGoodVariant[]
}
mergedOriginGoods?: MergedOriginGoodSummary[]
}
export interface CreateGoodRequest {
export interface MergedOriginGoodSummary {
id: string
sdsGoodId: string
goodName: string | null
goodImage: string | null
goodPrice: string | null
hasDetail: boolean
variantCount: number
}
export interface OriginGoodDetail {
productCode?: string | null
englishName?: string | null
productionCycleHours?: number | null
minWeightG?: string | null
productionProcess?: string | null
materialDescription?: string | null
sizeChart?: { columns?: Array<{ key: string; name: string }>; rows?: any[] } | null
packageSpecs?: { rows?: any[] } | null
syncedAt?: string | null
[key: string]: unknown
}
export interface OriginGoodVariant {
sdsVariantId: string
sku: string
sizeName?: string | null
colorName?: string | null
colorHex?: string | null
price?: string | null
enabled: boolean
[key: string]: unknown
}
export interface CustomGoodVariantRequest {
sku: string
sizeId?: string | null
sizeName?: string | null
colorId?: string | null
colorName?: string | null
colorHex?: string | null
imageUrl?: string | null
price?: string | null
originalPrice?: string | null
weightG?: string | null
boxLengthCm?: string | null
boxWidthCm?: string | null
boxHeightCm?: string | null
designData?: Record<string, unknown> | null
enabled?: boolean
sortOrder?: number
}
export interface CustomGoodDetailRequest {
productCode?: string | null
englishName?: string | null
productionCycleHours?: number | null
minWeightG?: string | null
productionProcess?: string | null
materialDescription?: string | null
blankDesignUrl?: string | null
detailsPageVideoUrl?: string | null
textureName?: string | null
reminder?: string | null
productPerformance?: string | null
applicableScenarios?: string | null
washingInstructions?: string | null
specialDescription?: string | null
designExplanation?: string | null
designArea?: string | null
pictureRequest?: string | null
sizeChart?: Record<string, unknown> | null
packageSpecs?: Record<string, unknown> | null
options?: Record<string, unknown> | null
media?: Record<string, unknown> | null
}
export interface GoodDetail extends Good {
originDetail: OriginGoodDetail | null
variants: OriginGoodVariant[]
}
export interface CreateGoodRequest {
goodName: string
goodImage?: string
originGoodId: number
@@ -124,29 +135,30 @@ export interface CreateGoodRequest {
categoryId: number
tagIds?: number[]
positionId?: number
goodPriority?: number
}
export interface CreateCustomGoodRequest {
goodName: string
goodImage?: string
goodPrice?: string | null
countryId: number
categoryId: number
tagIds?: number[]
positionId?: number
goodPriority?: number
detail?: CustomGoodDetailRequest
variants?: CustomGoodVariantRequest[]
}
export interface UpdateCustomGoodContentRequest {
goodName?: string
goodImage?: string | null
goodPrice?: string | null
detail?: CustomGoodDetailRequest
variants?: CustomGoodVariantRequest[]
}
goodPriority?: number
mergedOriginGoodIds?: number[]
}
export interface CreateCustomGoodRequest {
goodName: string
goodImage?: string
goodPrice?: string | null
countryId: number
categoryId: number
tagIds?: number[]
positionId?: number
goodPriority?: number
detail?: CustomGoodDetailRequest
variants?: CustomGoodVariantRequest[]
}
export interface UpdateCustomGoodContentRequest {
goodName?: string
goodImage?: string | null
goodPrice?: string | null
detail?: CustomGoodDetailRequest
variants?: CustomGoodVariantRequest[]
}
export interface UpdateGoodRequest {
goodName?: string
@@ -157,6 +169,7 @@ export interface UpdateGoodRequest {
tagIds?: number[]
positionId?: number | null
goodPriority?: number
mergedOriginGoodIds?: number[]
}
export interface BatchCreateItem {
@@ -329,28 +342,28 @@ export interface UpdatePositionRequest {
}
// Origin Good types
export interface OriginGood {
export interface OriginGood {
id: string
goodName: string | null
goodImage: string | null
goodPrice: string | null
sdsGoodId: string
source: 'SDS' | 'CUSTOM'
isCustom: boolean
sdsGoodId: string
source: 'SDS' | 'CUSTOM'
isCustom: boolean
sdsCategoryId: string | null
delisted?: boolean
createdAt: string
updatedAt: string
hasDetail?: boolean
detailSyncedAt?: string | null
variantCount?: number
sizeRowCount?: number
packageRowCount?: number
productCode?: string | null
updatedAt: string
hasDetail?: boolean
detailSyncedAt?: string | null
variantCount?: number
sizeRowCount?: number
packageRowCount?: number
productCode?: string | null
}
// Origin Goods Tree types
export interface OriginGoodsTreeNode {
export interface OriginGoodsTreeNode {
id: string
goodName: string
goodImage: string | null
@@ -359,12 +372,12 @@ export interface OriginGoodsTreeNode {
delisted: boolean
configuredCount: number
configuredCountries: string[]
configuredTags: { tagName: string; tagColor: string | null; tagFontColor: string | null; tagGroupId: string | null; tagGroupName: string | null; sortOrder: number }[]
hasDetail: boolean
detailSyncedAt: string | null
variantCount: number
sizeRowCount: number
packageRowCount: number
configuredTags: { tagName: string; tagColor: string | null; tagFontColor: string | null; tagGroupId: string | null; tagGroupName: string | null; sortOrder: number }[]
hasDetail: boolean
detailSyncedAt: string | null
variantCount: number
sizeRowCount: number
packageRowCount: number
}
export interface OriginGoodsTreeCategoryNode {
@@ -384,14 +397,14 @@ export interface OriginGoodsTreeResponse {
}
// Sync types
export interface SyncLog {
id: string
type: 'CATEGORIES' | 'PRODUCTS' | 'PRODUCT_DETAILS'
status: 'RUNNING' | 'SUCCESS' | 'FAILED'
message: string | null
startedAt: string
finishedAt: string | null
}
export interface SyncLog {
id: string
type: 'CATEGORIES' | 'PRODUCTS' | 'PRODUCT_DETAILS'
status: 'RUNNING' | 'SUCCESS' | 'FAILED'
message: string | null
startedAt: string
finishedAt: string | null
}
// Filter types
export interface GoodsFilter {
File diff suppressed because it is too large Load Diff