修复:保护平台订单原始事实不被清理和覆盖
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user