test: expand domestic container acceptance coverage
This commit is contained in:
+2
-1
@@ -81,7 +81,8 @@ public class DomesticContainerService {
|
||||
DomesticContainerInventoryEntity inventory = repository.lockInventory(warehouse.getId(), normalize(request.containerNo()));
|
||||
if (inventory == null) throw new BizException(ResultCode.NOT_FOUND, "整柜库存不存在");
|
||||
if ("COMPLETED".equals(request.status())) {
|
||||
if (request.inventoryVersion() != null && !request.inventoryVersion().equals(inventory.getVersion())) throw new BizException(ResultCode.CONFLICT, "库存已被修改,请刷新后重试");
|
||||
if (request.inventoryVersion() == null) throw new BizException(ResultCode.VALIDATION_FAILED, "完成出库必须提供库存版本");
|
||||
if (!request.inventoryVersion().equals(inventory.getVersion())) throw new BizException(ResultCode.CONFLICT, "库存已被修改,请刷新后重试");
|
||||
if (request.boxCount() > inventory.getAvailableBoxes()) throw new BizException(ResultCode.CONFLICT, "出库箱数超过可用库存");
|
||||
}
|
||||
DomesticContainerOrderEntity order = new DomesticContainerOrderEntity(); order.setId(IdWorker.getId()); order.setTenantId(PLATFORM_TENANT); order.setBusinessType("OUTBOUND");
|
||||
|
||||
@@ -74,7 +74,7 @@ components:
|
||||
status: { type: string, enum: [PENDING, COMPLETED] }
|
||||
remark: { type: string, maxLength: 500 }
|
||||
idempotencyKey: { type: string, maxLength: 128 }
|
||||
inventoryVersion: { type: integer, minimum: 0 }
|
||||
inventoryVersion: { type: integer, minimum: 0, description: 完成出库时必填;待出库不扣减库存时可不传 }
|
||||
ApiEnvelope:
|
||||
type: object
|
||||
required: [code, message, timestamp]
|
||||
|
||||
Reference in New Issue
Block a user