移除了 khhao 平台相关
This commit is contained in:
@@ -57,7 +57,7 @@ export function filterLegacyOrderFulfillmentBindings(bindings = []) {
|
||||
}
|
||||
|
||||
export function isKuaishouCloudFulfillmentBinding(binding = {}) {
|
||||
return String(binding?.provider || '').trim() === 'khhao'
|
||||
return String(binding?.provider || '').trim() === '91kaquan'
|
||||
&& String(binding?.platform || '').trim() === 'kuaishou'
|
||||
}
|
||||
|
||||
@@ -70,7 +70,6 @@ function normalizeOrderFulfillmentBinding(rawValue) {
|
||||
const platform = String(rawValue.platform || '').trim()
|
||||
const shopId = String(rawValue.shopId || '').trim()
|
||||
const shopName = String(rawValue.shopName || '').trim()
|
||||
const khhaoShopId = String(rawValue.khhaoShopId || '').trim()
|
||||
const skuCode = String(rawValue.skuCode || '').trim()
|
||||
const skuName = String(rawValue.skuName || '').trim()
|
||||
const profileKey = String(rawValue.profileKey || '').trim() || 'manual_review'
|
||||
@@ -88,7 +87,6 @@ function normalizeOrderFulfillmentBinding(rawValue) {
|
||||
platform,
|
||||
shopId,
|
||||
shopName,
|
||||
khhaoShopId,
|
||||
skuCode,
|
||||
skuName,
|
||||
profileKey,
|
||||
|
||||
@@ -6,10 +6,10 @@ import {
|
||||
isKuaishouCloudFulfillmentBinding,
|
||||
} from './fulfillment-binding-config-service.js'
|
||||
|
||||
test('isKuaishouCloudFulfillmentBinding only marks khhao kuaishou rules as cloud rules', () => {
|
||||
test('isKuaishouCloudFulfillmentBinding only marks 91kaquan kuaishou rules as cloud rules', () => {
|
||||
assert.equal(
|
||||
isKuaishouCloudFulfillmentBinding({
|
||||
provider: 'khhao',
|
||||
provider: '91kaquan',
|
||||
platform: 'kuaishou',
|
||||
}),
|
||||
true,
|
||||
@@ -24,7 +24,7 @@ test('isKuaishouCloudFulfillmentBinding only marks khhao kuaishou rules as cloud
|
||||
)
|
||||
})
|
||||
|
||||
test('filterLegacyOrderFulfillmentBindings keeps agiso rules and removes khhao kuaishou rules', () => {
|
||||
test('filterLegacyOrderFulfillmentBindings keeps agiso rules and removes 91kaquan kuaishou rules', () => {
|
||||
assert.deepEqual(
|
||||
filterLegacyOrderFulfillmentBindings([
|
||||
{
|
||||
@@ -34,10 +34,9 @@ test('filterLegacyOrderFulfillmentBindings keeps agiso rules and removes khhao k
|
||||
skuCode: 'sku-a',
|
||||
},
|
||||
{
|
||||
provider: 'khhao',
|
||||
provider: '91kaquan',
|
||||
platform: 'kuaishou',
|
||||
shopId: '4269276762',
|
||||
khhaoShopId: '10',
|
||||
shopId: '91kaquan',
|
||||
skuCode: 'sku-b',
|
||||
},
|
||||
]),
|
||||
|
||||
@@ -30,10 +30,9 @@ export function mapKuaishouCloudFulfillmentItemsToBindings(config = {}) {
|
||||
return items
|
||||
.filter((item) => item && item.enabled !== false)
|
||||
.map((item) => ({
|
||||
provider: String(item.provider || 'khhao').trim() || 'khhao',
|
||||
provider: String(item.provider || '91kaquan').trim() || '91kaquan',
|
||||
platform: String(item.platform || 'kuaishou').trim() || 'kuaishou',
|
||||
shopId: String(item.shopId || '').trim(),
|
||||
khhaoShopId: String(item.khhaoShopId || '').trim(),
|
||||
skuCode: String(item.internalSkuCode || '').trim(),
|
||||
skuName: String(item.internalSkuName || '').trim(),
|
||||
profileKey: 'kuaishou_ct_assisted',
|
||||
@@ -121,10 +120,9 @@ function normalizeKuaishouCloudFulfillmentItem(rawValue) {
|
||||
id: String(rawValue.id || internalSkuCode).trim() || internalSkuCode,
|
||||
enabled: rawValue.enabled !== false,
|
||||
priority: normalizePriority(rawValue.priority),
|
||||
provider: String(rawValue.provider || 'khhao').trim() || 'khhao',
|
||||
provider: String(rawValue.provider || '91kaquan').trim() || '91kaquan',
|
||||
platform: String(rawValue.platform || 'kuaishou').trim() || 'kuaishou',
|
||||
shopId: String(rawValue.shopId || '').trim(),
|
||||
khhaoShopId: String(rawValue.khhaoShopId || '').trim(),
|
||||
internalSkuCode,
|
||||
internalSkuName: String(rawValue.internalSkuName || '').trim() || internalSkuCode,
|
||||
externalSkuCode,
|
||||
|
||||
@@ -3,16 +3,15 @@ import assert from 'node:assert/strict'
|
||||
|
||||
import { mapKuaishouCloudFulfillmentItemsToBindings } from './kuaishou-cloud-fulfillment-config-service.js'
|
||||
|
||||
test('mapKuaishouCloudFulfillmentItemsToBindings preserves khhao shop id', () => {
|
||||
test('mapKuaishouCloudFulfillmentItemsToBindings maps 91kaquan rules', () => {
|
||||
assert.deepEqual(
|
||||
mapKuaishouCloudFulfillmentItemsToBindings({
|
||||
items: [
|
||||
{
|
||||
enabled: true,
|
||||
provider: 'khhao',
|
||||
provider: '91kaquan',
|
||||
platform: 'kuaishou',
|
||||
shopId: '4269276762',
|
||||
khhaoShopId: '10',
|
||||
shopId: '91kaquan',
|
||||
internalSkuCode: 'sku-1',
|
||||
internalSkuName: '内部商品',
|
||||
externalSkuCode: '952',
|
||||
@@ -24,10 +23,9 @@ test('mapKuaishouCloudFulfillmentItemsToBindings preserves khhao shop id', () =>
|
||||
}),
|
||||
[
|
||||
{
|
||||
provider: 'khhao',
|
||||
provider: '91kaquan',
|
||||
platform: 'kuaishou',
|
||||
shopId: '4269276762',
|
||||
khhaoShopId: '10',
|
||||
shopId: '91kaquan',
|
||||
skuCode: 'sku-1',
|
||||
skuName: '内部商品',
|
||||
profileKey: 'kuaishou_ct_assisted',
|
||||
|
||||
Reference in New Issue
Block a user