fix(dropship): preserve carton quantities and shared pallet outbound ownership
This commit is contained in:
@@ -2,6 +2,17 @@ import test from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { normalizeModuleOrder } from '../admin-test-env-acceptance.mjs'
|
||||
import { sameOutboundTask } from './dropship-pallet-matrix.mjs'
|
||||
|
||||
test('outbound replay preserves business identity and database millisecond timestamps', () => {
|
||||
const task = { id: '1', taskNo: 'PDA1', outboundNo: 'OD1', status: 'PENDING', pushedAt: '2026-09-14T20:24:45.920278604' }
|
||||
assert.equal(sameOutboundTask(task, { ...task, pushedAt: '2026-09-14T20:24:45.92' }), true)
|
||||
assert.equal(sameOutboundTask({ ...task, pushedAt: '2026-09-14T20:24:45.9999' },
|
||||
{ ...task, pushedAt: '2026-09-14T20:24:46' }), true)
|
||||
for (const key of ['id', 'taskNo', 'outboundNo', 'status', 'pushedAt']) {
|
||||
assert.equal(sameOutboundTask(task, { ...task, [key]: 'changed' }), false)
|
||||
}
|
||||
})
|
||||
|
||||
const source = readFileSync(new URL('./dropship-pallet-matrix.mjs', import.meta.url), 'utf8')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user