优化接单商品匹配
This commit is contained in:
@@ -8,6 +8,9 @@ import type {
|
||||
WorkOrderShare,
|
||||
WorkOrderStatistics,
|
||||
WorkProductRule,
|
||||
WorkProductRuleMapping,
|
||||
KuaishouMatchSource,
|
||||
WorkProductMatchLog,
|
||||
WorkerFinanceConfig,
|
||||
WorkerFinanceRequest,
|
||||
WorkerPlatformNotificationConfig,
|
||||
@@ -135,6 +138,63 @@ export function deleteAdminWorkProductRule(ruleId: number) {
|
||||
return apiDelete<{ deleted: boolean }>(`/api/v1/admin/worker-platform/product-rules/${ruleId}`)
|
||||
}
|
||||
|
||||
export function fetchAdminWorkProductRuleMappings() {
|
||||
return apiGet<{ items: WorkProductRuleMapping[] }>(
|
||||
'/api/v1/admin/worker-platform/product-mappings',
|
||||
)
|
||||
}
|
||||
|
||||
export function saveAdminWorkProductRuleMapping(payload: {
|
||||
mappingId?: number
|
||||
ruleId: number
|
||||
sellerIds: string[]
|
||||
relItemId?: string
|
||||
itemTitle?: string
|
||||
relSkuId?: string
|
||||
skuNick?: string
|
||||
mappingType: 'product_default' | 'sku_exact' | 'sku_series'
|
||||
enabled?: boolean
|
||||
}) {
|
||||
return apiPost<{ mapping: WorkProductRuleMapping }>(
|
||||
'/api/v1/admin/worker-platform/product-mappings',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function deleteAdminWorkProductRuleMapping(mappingId: number) {
|
||||
return apiDelete<{ deleted: boolean }>(
|
||||
`/api/v1/admin/worker-platform/product-mappings/${mappingId}`,
|
||||
)
|
||||
}
|
||||
|
||||
export function fetchAdminKuaishouMatchSources(limit = 100) {
|
||||
return apiGet<{ items: KuaishouMatchSource[] }>(
|
||||
'/api/v1/admin/worker-platform/product-match-sources',
|
||||
{
|
||||
limit,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
export function testAdminKuaishouProductMatch(rawPayload: string) {
|
||||
return apiPost<{
|
||||
context: Record<string, string>
|
||||
status: 'matched' | 'unmatched' | 'ambiguous'
|
||||
mappingId: number | null
|
||||
rule: WorkProductRule | null
|
||||
candidates: Array<{ ruleKey: string; score: number; mappingId: number | null }>
|
||||
}>('/api/v1/admin/worker-platform/product-match-test', { rawPayload })
|
||||
}
|
||||
|
||||
export function fetchAdminWorkProductMatchLogs(limit = 100) {
|
||||
return apiGet<{ items: WorkProductMatchLog[] }>(
|
||||
'/api/v1/admin/worker-platform/product-match-logs',
|
||||
{
|
||||
limit,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
export function reprocessAdminKuaishouWorkOrderMatches(limit = 100) {
|
||||
return apiPost<{ scannedCount: number; createdCount: number; skippedCount: number }>(
|
||||
'/api/v1/admin/worker-platform/orders/reprocess-matches',
|
||||
|
||||
Reference in New Issue
Block a user