test: use current order remarks contract

This commit is contained in:
2026-09-14 17:29:03 +08:00
parent 64bddb1f81
commit 4c048d0760
2 changed files with 15 additions and 3 deletions
@@ -27,6 +27,13 @@ test('create and submit lifecycle covers replay payload conflict and zero drift'
assert.match(source, /orderPersistenceFacts\(submittedAfterFailure\) === orderPersistenceFacts\(submitted\)/)
})
test('admin internal notes use the current versioned collaborative remarks contract', () => {
assert.match(source, /context\.request\('PUT',[\s\S]*\/remarks\?tenantId=/)
assert.match(source, /expectedVersion:\s*Number\(firstLegDetail\?\.order\?\.version\)/)
assert.match(source, /internalRemark:\s*`\$\{context\.marker\} Admin 订单链路验收`/)
assert.doesNotMatch(source, /\/internal-notes/)
})
test('persistence fact comparison includes order cargo parties notes and history', () => {
const detail = {
order: { id: '1', status: 'DRAFT' }, cargoes: [{ skuNo: 'SKU-1' }],
+8 -3
View File
@@ -688,9 +688,14 @@ export async function run(context) {
`cargoes=${firstLegDetail?.cargoes?.length ?? 'n/a'}, history=${firstLegDetail?.statusHistory?.length ?? 'n/a'}`)
assertCargoContract(context, firstLegDetailResponse, firstLegDetail?.cargoes, payload)
const noteResponse = await context.request('POST',
`/api/platform/v1/orders/first-leg/${encodeURIComponent(orderId)}/internal-notes?tenantId=${encodeURIComponent(tenantId)}`,
{ content: `${context.marker} Admin 订单链路验收` })
const noteResponse = await context.request('PUT',
`/api/platform/v1/orders/first-leg/${encodeURIComponent(orderId)}/remarks?tenantId=${encodeURIComponent(tenantId)}`,
{
expectedVersion: Number(firstLegDetail?.order?.version),
internalRemark: `${context.marker} Admin 订单链路验收`,
warehouseRemark: firstLegDetail?.order?.warehouseRemark || null,
customerServiceRemark: firstLegDetail?.order?.customerServiceRemark || null,
})
context.apiSuccess(MODULE, 'Admin 为本轮订单添加内部备注', noteResponse)
const approveResponse = await context.request('POST',