fix(transfer): preserve inbound ownership and expose durable receipt recovery

This commit is contained in:
2026-10-05 06:34:23 +08:00
parent 47acfc991b
commit 548a133de6
10 changed files with 306 additions and 16 deletions
@@ -1106,7 +1106,7 @@ paths:
idempotencyKey: { type: string, maxLength: 255 }
remark: { type: string, nullable: true, maxLength: 1000 }
responses:
'200': { description: 原转运详情,部分来源PARTIALLY_RECEIVED、全部来源RECEIVED;原键原载荷返回原收货结果 }
'200': { description: 原转运详情,部分来源PARTIALLY_RECEIVED、全部来源RECEIVED;receiptCommands包含真正COMPLETED的本次命令,原键原载荷返回持久结果, content: { application/json: { schema: { $ref: '#/components/schemas/WarehouseTransferDetailApiResponse' } } } }
'409': { description: 原请求冲突、来源状态或目标资源归属不匹配;不得换键绕过 }
'503': { description: 资源服务不可用,保留原收货命令待核对恢复 }
/api/platform/v1/last-leg/warehouse-transfers/{transferNo}/outbound:
@@ -1193,7 +1193,7 @@ paths:
description: 权限 merchant:overseas-warehouse:transfer:list;不泄露其他客户订单。
security: [{ bearerAuth: [] }]
parameters: [{ name: transferNo, in: path, required: true, schema: { type: string } }]
responses: { '200': { description: 当前客户仓储转运单详情 }, '403': { description: 缺少仓储转运查看权限 }, '404': { description: 当前客户下转运单不存在 } }
responses: { '200': { description: 当前客户仓储转运单详情,receiptCommands仅本客户本票;未知状态或损坏快照拒绝返回,不当作新请求, content: { application/json: { schema: { $ref: '#/components/schemas/WarehouseTransferDetailApiResponse' } } } }, '403': { description: 缺少仓储转运查看权限 }, '404': { description: 当前客户下转运单不存在 }, '409': { description: 持久实收命令状态、原请求或目标损坏,须核查原命令 } }
/api/merchant/v1/last-leg/warehouse-transfers/{transferNo}/confirm-measurement:
post:
summary: 客户确认仓储转运实测数据
@@ -1844,6 +1844,62 @@ paths:
responses: { '200': { description: 退货箱唛打印数据 }, '404': { description: 当前仓没有该退货箱 } }
components:
schemas:
WarehouseTransferDetailApiResponse:
type: object
properties:
data: { $ref: '#/components/schemas/WarehouseTransferDetail' }
WarehouseTransferDetail:
type: object
description: 保留原转运详情字段;新增持久实收命令投影供平台与当前客户恢复。成功实收返回本地事务完成后的命令状态,不暴露内部资源锁或reservationKey。
required: [receiptCommands]
properties:
receiptCommands:
type: array
items: { $ref: '#/components/schemas/WarehouseTransferReceiptCommand' }
WarehouseTransferReceiptCommand:
type: object
additionalProperties: false
required: [sourceInventoryPositionId, status, requestHash, request, target]
properties:
sourceInventoryPositionId: { type: string, description: 原来源库存位置标识,仅用于原命令恢复 }
status: { type: string, enum: [PREPARED, RESERVED, COMPLETED] }
requestHash: { type: string, pattern: '^[a-f0-9]{64}$' }
request: { $ref: '#/components/schemas/WarehouseTransferReceiptRequest' }
target: { $ref: '#/components/schemas/WarehouseTransferReceiptTarget' }
WarehouseTransferReceiptTarget:
type: object
additionalProperties: false
required: [warehouseId, warehouseCode, warehouseName, palletId, palletNo, locationId, locationCode, fbaId, fbaCode, fbaName]
properties:
warehouseId: { type: string }
warehouseCode: { type: string }
warehouseName: { type: string }
palletId: { type: string }
palletNo: { type: string }
locationId: { type: string }
locationCode: { type: string }
fbaId: { type: string }
fbaCode: { type: string }
fbaName: { type: string }
WarehouseTransferReceiptRequest:
type: object
additionalProperties: false
required: [sourceInventoryPositionId, destinationOverseasWarehouseId, destinationWarehouseCode, destinationPalletId, destinationPalletNo, idempotencyKey]
properties:
sourceInventoryPositionId: { type: integer, format: int64 }
destinationOverseasWarehouseId: { type: string, maxLength: 128 }
destinationOverseasWarehouseCode: { type: string, nullable: true, maxLength: 128 }
destinationOverseasWarehouseName: { type: string, nullable: true, maxLength: 255 }
destinationWarehouseId: { type: string, nullable: true, maxLength: 128 }
destinationWarehouseCode: { type: string, maxLength: 128 }
destinationWarehouseName: { type: string, nullable: true, maxLength: 255 }
destinationPalletId: { type: integer, format: int64 }
destinationPalletNo: { type: string, maxLength: 128 }
batchNo: { type: string, nullable: true, maxLength: 128 }
warehouseLocationId: { type: integer, format: int64, nullable: true }
warehouseLocationCode: { type: string, nullable: true, maxLength: 128 }
idempotencyKey: { type: string, maxLength: 255 }
remark: { type: string, nullable: true, maxLength: 1000 }
ExceptionOrderDetailResponse:
type: object
properties: