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
@@ -0,0 +1,17 @@
-- 146_voucher_consume_fallback_channel.sql
--
-- 未命中任何履约渠道时,允许按平台兜底策略安排电子凭证核销。
-- unmatched 只表示核销任务来源,不会写回 order_items.fulfillment_channel。
ALTER TABLE voucher_consume_jobs
DROP CONSTRAINT IF EXISTS voucher_consume_jobs_channel_check;
ALTER TABLE voucher_consume_jobs
ADD CONSTRAINT voucher_consume_jobs_channel_check
CHECK (channel IN (
'affiliate_dash', 'work_order', 'manual',
'third_party_voucher', 'on_account', 'unmatched'
));
COMMENT ON COLUMN voucher_consume_jobs.channel IS
'触发核销时的履约渠道;unmatched 表示订单未命中任何履约渠道,由平台兜底策略触发';