fix(first-leg): preserve edit commands and add versioned cancellation

This commit is contained in:
2026-10-02 21:36:10 +08:00
parent c06c105836
commit dae119a1e8
6 changed files with 321 additions and 20 deletions
@@ -206,9 +206,9 @@ test('only blocks submission when a known company audit status is not active', (
assert.match(storeSource, /if \(companyAuditStatus && companyAuditStatus !== 'ACTIVE'\)/)
})
test('does not expose the out-of-scope cancellation write', () => {
assert.doesNotMatch(storeSource, /cancelMerchant|function cancel|\/cancel/)
assert.doesNotMatch(apiSource, /\/cancel/)
test('uses the versioned merchant cancellation contract', () => {
assert.match(storeSource, /cancelMerchantFirstLegOrder\(id, pending\.payload, pending\.key\)/)
assert.match(apiSource, /cancelMerchantFirstLegOrder\(id: number \| string, payload: \{ expectedVersion: number; reason: string \}, idempotencyKey: string\)/)
})
test('sends an idempotency key for create and submit writes', () => {