fix(procurement): read MySQL fulfillment timestamps with JDBC types

This commit is contained in:
2026-10-10 02:42:59 +08:00
parent a973be2103
commit c0fbe2698b
9 changed files with 37 additions and 20 deletions
+8 -1
View File
@@ -1,6 +1,6 @@
import test from 'node:test'
import assert from 'node:assert/strict'
import { execute, options } from './procurement-sample-test-env.mjs'
import { execute, options, accountForCustomer } from './procurement-sample-test-env.mjs'
test('default preview needs no credentials and performs no execution', async () => {
const result = await execute([], [])
@@ -15,3 +15,10 @@ test('execution rejects an absent or different environment file before login', a
await assert.rejects(execute(args, []), /TEST 环境文件/)
await assert.rejects(execute(args, ['--env-file=C:\\private\\production.env']), /TEST 环境文件/)
})
test('Finance uses a data array and matches the exact customer without numeric coercion', () => {
const row = { customerId:'9007199254740993', accountVersion:0, actualBalance:'0.00' }
assert.equal(accountForCustomer([{ customerId:'9007199254740992' }, row], '9007199254740993'), row)
assert.throws(() => accountForCustomer({ records:[row] }, row.customerId), /正式数组/)
assert.throws(() => accountForCustomer([], row.customerId), /本轮独立客户/)
})