refactor(finance)!: 事实维度与接口字段统一改名 channel

- migration 114 将 sales_daily_facts.fulfillment_mode 重命名为 channel
- DTO/查询参数/前端类型从 fulfillmentMode 统一为 channel
- 成本中心类型 FulfillmentMode 更名为 FulfillmentChannel,并补齐卡券/待分类/归档取值
- 销售事实响应分组改为 byChannel
This commit is contained in:
yml2213
2026-10-31 20:26:15 +08:00
parent 657e49f324
commit 6cd6401eca
38 changed files with 220 additions and 208 deletions
@@ -104,7 +104,7 @@ test('订单列表按当前履约模式筛选,不再依赖任务执行器', as
const calls: Array<{ sql: string; params: unknown[] }> = []
await listOrdersWithExecutor(createExecutor(calls, 0), {
fulfillmentMode: 'manual',
channel: 'manual',
})
assert.match(calls[0]?.sql || '', /oi\.fulfillment_channel = \$1/)
@@ -118,7 +118,7 @@ test('订单列表待判定筛选不扫描任务执行器', async () => {
const calls: Array<{ sql: string; params: unknown[] }> = []
await listOrdersWithExecutor(createExecutor(calls, 0), {
fulfillmentMode: 'pending',
channel: 'pending',
})
assert.match(calls[0]?.sql || '', /EXISTS/)
@@ -131,7 +131,7 @@ test('订单列表历史平台筛选映射为 archived', async () => {
const calls: Array<{ sql: string; params: unknown[] }> = []
await listOrdersWithExecutor(createExecutor(calls, 0), {
fulfillmentMode: 'legacy_platform',
channel: 'legacy_platform',
})
assert.match(calls[0]?.sql || '', /oi\.fulfillment_status = 'archived'/)
@@ -142,7 +142,7 @@ test('订单列表混合履约筛选按订单项聚合判定', async () => {
const calls: Array<{ sql: string; params: unknown[] }> = []
await listOrdersWithExecutor(createExecutor(calls, 0), {
fulfillmentMode: 'mixed',
channel: 'mixed',
})
assert.match(calls[0]?.sql || '', /HAVING COUNT\(DISTINCT oi\.fulfillment_channel\) > 1/)