diff --git a/scripts/admin-test-env-modules/orders-lifecycle-idempotency-contract.test.mjs b/scripts/admin-test-env-modules/orders-lifecycle-idempotency-contract.test.mjs index 252eb2900..892b6d86d 100644 --- a/scripts/admin-test-env-modules/orders-lifecycle-idempotency-contract.test.mjs +++ b/scripts/admin-test-env-modules/orders-lifecycle-idempotency-contract.test.mjs @@ -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' }], diff --git a/scripts/admin-test-env-modules/orders.mjs b/scripts/admin-test-env-modules/orders.mjs index 8850c800c..e1e4d077c 100644 --- a/scripts/admin-test-env-modules/orders.mjs +++ b/scripts/admin-test-env-modules/orders.mjs @@ -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',