通知系统-1
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
} from '../../../repositories/inventory-repo.js'
|
||||
import { ensureAgisoXianyuAutoDeliveryForDeliveredTask } from '../../platforms/agiso/xianyu/auto-delivery-service.js'
|
||||
import { syncKuaishouCloudRoleInfo } from '../kuaishou-cloud-sync-service.js'
|
||||
import { notifyClaimRedeemNeedsAttention } from '../../notification/domain-notifications.js'
|
||||
import { createHttpError } from '../../../utils/http.js'
|
||||
import { nowIso } from '../../../utils/time.js'
|
||||
import { getClaimContext, getClaimContextByTaskId } from './context.js'
|
||||
@@ -297,6 +298,15 @@ async function finalizeClaimTaskRedeem(context) {
|
||||
updated_at: now,
|
||||
})
|
||||
|
||||
if (['retry_pending', 'waiting_inventory', 'manual_review'].includes(String(failureState.taskStatus || '').trim())) {
|
||||
await notifyClaimRedeemNeedsAttention({
|
||||
task: failedTask,
|
||||
order: context.order,
|
||||
status: failureState.taskStatus,
|
||||
errorMessage: failureState.lastError,
|
||||
})
|
||||
}
|
||||
|
||||
throw Object.assign(error instanceof Error ? error : new Error(String(error || '兑换失败')), {
|
||||
task: failedTask,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user