fix: complete October 22 workflow feedback and request failure recovery

This commit is contained in:
2026-10-22 23:06:02 +08:00
parent 22baa5b5c0
commit 3ffa706b89
7 changed files with 123 additions and 381 deletions
@@ -220,7 +220,7 @@ test('only blocks submission when a known company audit status is not active', (
})
test('uses the versioned merchant cancellation contract', () => {
assert.match(storeSource, /cancelMerchantFirstLegOrder\(id, pending\.payload, pending\.key\)/)
assert.match(storeSource, /cancelMerchantFirstLegOrder\(id, payload, createIdempotencyKey\(/)
assert.match(apiSource, /cancelMerchantFirstLegOrder\(id: number \| string, payload: \{ expectedVersion: number; reason: string \}, idempotencyKey: string\)/)
})
@@ -231,8 +231,8 @@ test('sends an idempotency key for create and submit writes', () => {
assert.match(apiSource, /createMerchantFirstLegOrderBatch\(items: MerchantBatchDraftItem\[\], idempotencyKey: string\)/)
assert.match(apiSource, /headers: \{ 'Idempotency-Key': idempotencyKey \}/)
assert.match(storeSource, /createMerchantFirstLegOrderBatch\(items, idempotencyKey\)/)
assert.match(storeSource, /pendingSubmissions\.get\(id\)/)
assert.match(storeSource, /submitMerchantFirstLegOrder\(id, pending\.payload, pending\.key\)/)
assert.doesNotMatch(storeSource, /pendingSubmissions|pendingEdits|pendingCancellation/)
assert.match(storeSource, /submitMerchantFirstLegOrder\(id, \{ expectedVersion: order\.version \}, createIdempotencyKey\(/)
})
test('does not expose the contradictory backend rejected state in the client model', () => {