feat(cost-center): 卡券规则批量生成与异常标签补齐

- 新增「批量生成渠道规则」,为 tpv: 商品一次性补 third_party_voucher 规则
- 异常原因补「缺少履约载体」,渠道标签补卡券/待分类/归档/未分类
This commit is contained in:
yml2213
2026-10-31 20:41:50 +08:00
parent a62f6e1ec8
commit 7fab610159
4 changed files with 75 additions and 7 deletions
@@ -6,6 +6,8 @@
*/
import { Router } from 'express'
import { ensureVoucherChannelRules } from '../../services/fulfillment/channel-assign-service.js'
import {
backfillAdminNormalizedQuantities,
backfillAdminProductMappings,
@@ -364,4 +366,20 @@ router.post(
),
)
router.post(
'/cost-center/voucher-products/ensure-rules',
requireAdminPermission('finance.config'),
createJsonHandler(() => ensureVoucherChannelRules(), {
successMessage: '卡券渠道规则已补齐',
errorMessage: '补齐卡券渠道规则失败',
scope: '[admin/cost-center/voucher-products/ensure-rules]',
audit: (_req, data) => ({
action: 'voucher_channel_rules_ensured',
targetType: 'sku_channel_rules',
targetId: '',
data: data as Record<string, unknown>,
}),
}),
)
export default router