This commit is contained in:
2026-08-14 10:09:46 +08:00
parent 0bc752a2be
commit 66089f9b99
31 changed files with 719 additions and 141 deletions
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict'
import fs from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import { run } from './finance-full-fixtures.mjs'
import { buildContainerCostBody, run } from './finance-full-fixtures.mjs'
const here = path.dirname(fileURLToPath(import.meta.url))
const source = fs.readFileSync(path.join(here, 'finance-full-fixtures.mjs'), 'utf8')
@@ -204,6 +204,13 @@ test('fixture creates four real receivable manual sources before payable source'
})
test('container cost uses loading plan identity and verifies snapshot fields before Finance', () => {
const body = buildContainerCostBody('RUN-1', '2088073097986560001',
{ loadingPlanId: '2088073275689709570' }, '2088073280000000001')
assert.equal(body.customerId, '2088073097986560001')
assert.equal(body.containerId, '2088073275689709570')
assert.equal(JSON.parse(JSON.stringify(body)).customerId, '2088073097986560001')
assert.match(source, /customerId: String\(customerId\)/)
assert.doesNotMatch(source, /customerId: Number\(customerId\)/)
assert.match(source, /containerId: String\(container\.loadingPlanId\)/)
assert.doesNotMatch(source, /containerId: Number\(container\.loadingPlanId\)/)
assert.match(source, /smart-loading\/plans\/\$\{encodeURIComponent\(container\.loadingPlanId\)\}/)