test(order): verify warehouse faults and await recovery projection
This commit is contained in:
@@ -260,12 +260,18 @@ export function buildOrderDependencyFaultPlan(fixture) {
|
||||
initialOrderSha256:createHash('sha256').update(orderPersistenceFacts(detail)).digest('hex') }
|
||||
}
|
||||
if (commands.merchant.orderId === commands.platform.orderId) throw new Error('Use two independent drafts for same-key recovery')
|
||||
return { marker:fixture.marker, customerId, runtimeChangesExecuted:false, commands,
|
||||
const receivingWarehouseId = id(fixture.merchant.order.receivingWarehouseId)
|
||||
if (!/^[1-9]\d*$/.test(receivingWarehouseId) || receivingWarehouseId !== id(fixture.platform.order.receivingWarehouseId)) {
|
||||
throw new Error('Dependency drafts must reference the same valid public receiving warehouse')
|
||||
}
|
||||
return { marker:fixture.marker, customerId, receivingWarehouseId, runtimeChangesExecuted:false, commands,
|
||||
phases:[
|
||||
{ dependency:'IAM', urlProperty:'baiyue.clients.iam.url', targetMethod:'GET', targetPath:`/internal/iam/tenants/${customerId}/order-eligibility`,
|
||||
faultHttp:503, expectedHttp:200, expectedCode:'S0503', expectedMessages:['IAM eligibility service is unavailable','IAM 下单资格响应无效'] },
|
||||
{ dependency:'FINANCE', urlProperty:'baiyue.clients.finance.url', targetMethod:'GET', targetPath:`/internal/finance/v1/wallet/accounts/${customerId}`,
|
||||
faultHttp:503, expectedHttp:200, expectedCode:'S0503', expectedMessages:['Finance account service is unavailable','Finance account response is invalid'] },
|
||||
{ dependency:'WAREHOUSE', urlProperty:'baiyue.clients.warehouse.url', targetMethod:'GET', targetPath:`/internal/warehouses/0/${receivingWarehouseId}/active`,
|
||||
faultHttp:503, expectedHttp:200, expectedCode:'S0503', expectedMessages:['主数据服务暂时不可用'] },
|
||||
],
|
||||
recovery:'Restore original Order image/config/network identity; submit each original frozen command once, then replay it; require one submission history and no duplicate Firstleg facts.' }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user