优化
This commit is contained in:
@@ -574,8 +574,7 @@ paths:
|
||||
expectedVersion: {type: integer, minimum: 0}
|
||||
reason: {type: string, maxLength: 1000}
|
||||
responses:
|
||||
'200': {description: 成功或业务失败;成功 data 为 FeeSnapshotResponse,nextStatus=WAIT_SPLIT}
|
||||
'409': {description: 审核已提交但自动编排尚未完成、版本冲突或费用/仓库门禁失败;不得据此推断 WAIT_SPLIT}
|
||||
'200': {description: 成功或业务失败,按响应体 code 判断;成功 data 为 FeeSnapshotResponse 且 nextStatus=WAIT_SPLIT;失败可能表示审核已提交但自动编排尚未完成、版本冲突或费用/仓库门禁失败,不得据此推断 WAIT_SPLIT}
|
||||
/api/platform/v1/inbounds/{inboundId}/measurements/reject:
|
||||
post:
|
||||
summary: 驳回测量
|
||||
|
||||
+2
-1
@@ -48,7 +48,8 @@ class InboundMeasurementReviewContractTest {
|
||||
.contains("Idempotency-Key")
|
||||
.contains("审核事务提交后服务端自动执行计费")
|
||||
.contains("接口不会伪造 WAIT_SPLIT")
|
||||
.contains("成功 data 为 FeeSnapshotResponse,nextStatus=WAIT_SPLIT")
|
||||
.contains("成功 data 为 FeeSnapshotResponse")
|
||||
.contains("nextStatus=WAIT_SPLIT")
|
||||
.contains("name: inboundId")
|
||||
.contains("schema: {type: string, pattern:")
|
||||
.doesNotContain("待客户确认");
|
||||
|
||||
@@ -25,6 +25,12 @@ test('覆盖国内仓、待单、完成入库、部分和全部出库及列表
|
||||
'/inventories/${inventoryId}', 'transactions?.length === 3']) assert.match(moduleSource, new RegExp(token.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')))
|
||||
})
|
||||
|
||||
test('在创建测试数据前覆盖无筛选整柜入库列表', () => {
|
||||
const unfilteredList = '`${BASE}/inbounds?page=1&size=20`'
|
||||
assert.match(moduleSource, /无筛选查询整柜入库单列表/)
|
||||
assert.ok(moduleSource.indexOf(unfilteredList) < moduleSource.indexOf("api(context, 'POST', `${BASE}/inbounds`"))
|
||||
})
|
||||
|
||||
test('覆盖库存不足、版本冲突及两类幂等行为', () => {
|
||||
assert.match(moduleSource, /库存不足禁止出库/)
|
||||
assert.match(moduleSource, /过期库存版本冲突/)
|
||||
|
||||
@@ -22,6 +22,11 @@ async function api(context, method, path, body, token = context.token) {
|
||||
|
||||
export async function run(context) {
|
||||
const marker = context.marker.replace(/[^A-Za-z0-9]/g, '').slice(-18)
|
||||
const initialInboundsResponse = await api(context, 'GET', `${BASE}/inbounds?page=1&size=20`)
|
||||
const initialInbounds = context.apiSuccess(MODULE, '无筛选查询整柜入库单列表', initialInboundsResponse)
|
||||
context.assert(MODULE, '无筛选整柜入库列表分页结构正确', initialInboundsResponse,
|
||||
Array.isArray(initialInbounds?.records) && Number(initialInbounds?.page) === 1 && Number(initialInbounds?.size) === 20,
|
||||
`records=${initialInbounds?.records?.length ?? 'missing'}, page=${initialInbounds?.page}, size=${initialInbounds?.size}`)
|
||||
const warehousesResponse = await api(context, 'GET', '/api/platform/v1/warehouse-admin?page=1&size=200&warehouseType=DOMESTIC&status=ACTIVE')
|
||||
const warehouses = context.apiSuccess(MODULE, '查询平台启用国内仓', warehousesResponse)
|
||||
const warehouse = warehouses?.records?.[0]
|
||||
|
||||
Reference in New Issue
Block a user