feat(fulfillment): 增加未命中渠道兜底核销

This commit is contained in:
yml2213
2026-11-06 19:21:41 +08:00
parent e85bbee7e0
commit 0a595acfa9
9 changed files with 200 additions and 13 deletions
@@ -11,6 +11,7 @@ export const VOUCHER_CONSUME_CHANNELS = [
'manual',
'third_party_voucher',
'on_account',
'unmatched',
] as const
export type VoucherConsumeChannel = (typeof VOUCHER_CONSUME_CHANNELS)[number]
@@ -156,6 +157,11 @@ function createDefaultPlatformPolicy(): VoucherPlatformConsumePolicy {
mode: 'manual',
delaySeconds: 0,
},
unmatched: {
enabled: false,
mode: 'after_order_received',
delaySeconds: 5,
},
},
}
}
@@ -199,6 +205,10 @@ function normalizePlatformPolicy(
'manual',
'after_order_received',
]),
unmatched: normalizeChannelPolicy(rawChannels.unmatched, fallback.channels.unmatched, [
'manual',
'after_order_received',
]),
},
}
}