fix(fulfillment): 封堵重复载体并完善统一SKU映射
This commit is contained in:
@@ -42,6 +42,34 @@ export type ChannelRuleListResult = {
|
||||
pageSize: number
|
||||
}
|
||||
|
||||
export type InternalSkuMappingMatchType =
|
||||
| 'sku_code'
|
||||
| 'sku_nick'
|
||||
| 'out_sku_sn'
|
||||
| 'spec'
|
||||
| 'sku_name'
|
||||
|
||||
export type InternalSkuMapping = {
|
||||
id: number
|
||||
provider: string
|
||||
shop_id: string
|
||||
match_type: InternalSkuMappingMatchType
|
||||
match_value: string
|
||||
internal_sku: string
|
||||
priority: number
|
||||
enabled: boolean
|
||||
source: string
|
||||
note: string
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
export type InternalSkuMappingListResult = {
|
||||
items: InternalSkuMapping[]
|
||||
total: number
|
||||
page: number
|
||||
pageSize: number
|
||||
}
|
||||
|
||||
export type ChannelException = {
|
||||
id: number
|
||||
reason: string
|
||||
@@ -142,6 +170,39 @@ export function fetchChannelRules(
|
||||
return apiGet<ChannelRuleListResult>('/api/v1/admin/fulfillment/rules', params)
|
||||
}
|
||||
|
||||
export function fetchInternalSkuMappings(
|
||||
params: {
|
||||
keyword?: string
|
||||
provider?: string
|
||||
shopId?: string
|
||||
matchType?: string
|
||||
page?: number
|
||||
pageSize?: number
|
||||
} = {},
|
||||
) {
|
||||
return apiGet<InternalSkuMappingListResult>(
|
||||
'/api/v1/admin/fulfillment/internal-sku-mappings',
|
||||
params,
|
||||
)
|
||||
}
|
||||
|
||||
export function saveInternalSkuMapping(payload: {
|
||||
provider?: string
|
||||
shopId?: string
|
||||
matchType: InternalSkuMappingMatchType
|
||||
matchValue: string
|
||||
internalSku: string
|
||||
priority?: number
|
||||
note?: string
|
||||
enabled?: boolean
|
||||
}) {
|
||||
return apiPost<{ id: number }>('/api/v1/admin/fulfillment/internal-sku-mappings', payload)
|
||||
}
|
||||
|
||||
export function deleteInternalSkuMapping(id: number) {
|
||||
return apiDelete<boolean>(`/api/v1/admin/fulfillment/internal-sku-mappings/${id}`)
|
||||
}
|
||||
|
||||
export function saveChannelRule(payload: {
|
||||
id?: number
|
||||
matchKeyType: string
|
||||
|
||||
Reference in New Issue
Block a user