修复:保护平台订单原始事实不被清理和覆盖

This commit is contained in:
yml2213
2026-11-09 13:20:36 +08:00
parent 9ff9eda3b3
commit 4159a435d5
22 changed files with 429 additions and 267 deletions
@@ -1,8 +1,18 @@
import assert from 'node:assert/strict'
import { readFile } from 'node:fs/promises'
import test from 'node:test'
import { listOrdersWithExecutor, type OrderQueryExecutor } from './order-repo.js'
test('订单更新永不覆盖首次写入的平台原始报文', async () => {
const source = await readFile(new URL('./order-repo.ts', import.meta.url), 'utf8')
const updateSource = source.slice(
source.indexOf('export async function updateOrderWithExecutor'),
source.indexOf('export async function getOrderById'),
)
assert.doesNotMatch(updateSource, /raw_payload_json\s*=/)
})
test('订单列表综合筛选下推到总数和分页查询', async () => {
const calls: Array<{ sql: string; params: unknown[] }> = []
const executor = createExecutor(calls, 3)