增加分组库存与客服
This commit is contained in:
@@ -964,6 +964,9 @@ export async function redeemClaimTaskWithInventoryFallbackWithDeps(
|
||||
taskId: context.task.id,
|
||||
credentialType: currentInventoryItem.credential_type || 'tencent_code',
|
||||
roleKey: 'primary_code',
|
||||
inventoryGroupCodes: currentInventoryItem.inventory_group_code
|
||||
? [String(currentInventoryItem.inventory_group_code).trim()]
|
||||
: null,
|
||||
})
|
||||
|
||||
if (!replacement || !String(replacement.display_value || '').trim()) {
|
||||
@@ -989,6 +992,7 @@ export async function redeemClaimTaskWithInventoryFallbackWithDeps(
|
||||
nextInventoryItemId: replacement.id,
|
||||
nextCodeMasked: maskCode(replacement.display_value),
|
||||
credentialType: String(replacement.credential_type || currentInventoryItem.credential_type || ''),
|
||||
inventoryGroupCode: String(replacement.inventory_group_code || currentInventoryItem.inventory_group_code || '').trim(),
|
||||
}, replacedAt)
|
||||
currentInventoryItem = replacement
|
||||
shouldReloadBeforeNextAttempt = true
|
||||
|
||||
@@ -22,11 +22,13 @@ test('redeemClaimTaskWithInventoryFallbackWithDeps invalidates missing CDKEY and
|
||||
id: 1,
|
||||
display_value: 'DJQFf7HgONCL4XD4EH',
|
||||
credential_type: 'tencent_code',
|
||||
inventory_group_code: 'A组',
|
||||
}
|
||||
const replacementInventoryItem = {
|
||||
id: 2,
|
||||
display_value: 'ABCD1234EFGH5678',
|
||||
credential_type: 'tencent_code',
|
||||
inventory_group_code: 'A组',
|
||||
}
|
||||
|
||||
let redeemCount = 0
|
||||
@@ -127,6 +129,7 @@ test('redeemClaimTaskWithInventoryFallbackWithDeps invalidates missing CDKEY and
|
||||
taskId: 42,
|
||||
credentialType: 'tencent_code',
|
||||
roleKey: 'primary_code',
|
||||
inventoryGroupCodes: ['A组'],
|
||||
},
|
||||
])
|
||||
assert.deepEqual(reloadCalls, ['txbs-test'])
|
||||
@@ -160,6 +163,7 @@ test('redeemClaimTaskWithInventoryFallbackWithDeps invalidates missing CDKEY and
|
||||
nextInventoryItemId: 2,
|
||||
nextCodeMasked: 'ABCD****5678',
|
||||
credentialType: 'tencent_code',
|
||||
inventoryGroupCode: 'A组',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user