refactor(finance)!: 事实维度与接口字段统一改名 channel
- migration 114 将 sales_daily_facts.fulfillment_mode 重命名为 channel - DTO/查询参数/前端类型从 fulfillmentMode 统一为 channel - 成本中心类型 FulfillmentMode 更名为 FulfillmentChannel,并补齐卡券/待分类/归档取值 - 销售事实响应分组改为 byChannel
This commit is contained in:
@@ -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/)
|
||||
|
||||
@@ -240,7 +240,7 @@ export async function listOrdersWithExecutor(
|
||||
keyword = '',
|
||||
provider = '',
|
||||
executorKey = '',
|
||||
fulfillmentMode = '',
|
||||
channel = '',
|
||||
platformOrderId = '',
|
||||
payStatus = '',
|
||||
taskStatus = '',
|
||||
@@ -334,9 +334,9 @@ export async function listOrdersWithExecutor(
|
||||
)
|
||||
}
|
||||
|
||||
if (fulfillmentMode) {
|
||||
if (channel) {
|
||||
// v2:渠道/状态拆列后按新列筛选;legacy_platform 统一映射成 archived。
|
||||
const normalizedMode = fulfillmentMode === 'legacy_platform' ? 'archived' : fulfillmentMode
|
||||
const normalizedMode = channel === 'legacy_platform' ? 'archived' : channel
|
||||
if (normalizedMode === 'pending') {
|
||||
filters.push(`EXISTS (
|
||||
SELECT 1 FROM order_items oi
|
||||
|
||||
Reference in New Issue
Block a user