This commit is contained in:
2026-08-11 18:43:50 +08:00
parent e1487162a5
commit bc5d9a6215
25 changed files with 1424 additions and 28 deletions
@@ -20,6 +20,16 @@ paths:
content: {application/json: {schema: {$ref: '#/components/schemas/ClaimRequest'}}}
responses:
'200': {description: Claimed task or A0409 when another operator owns it}
/api/platform/v1/first-leg/pda-loading/tasks/{taskId}/inventory-snapshot:
get:
summary: Read the current Warehouse inventory snapshot before atomic submission
parameters:
- {$ref: '#/components/parameters/TaskId'}
- {name: warehouseId, in: query, required: true, schema: {type: integer, format: int64, minimum: 1}}
responses:
'200':
description: Current occupied resources grouped by inbound order with a stable snapshot token
content: {application/json: {schema: {$ref: '#/components/schemas/InventorySnapshot'}}}
/api/platform/v1/first-leg/pda-loading/tasks/{taskId}/assign:
post:
summary: Assign or reassign a task with optimistic locking
@@ -91,11 +101,12 @@ components:
operationId: {type: string, maxLength: 128}
BatchRequest:
type: object
required: [warehouseId, containerNo, expectedVersion, items]
required: [warehouseId, containerNo, expectedVersion, inventorySnapshotToken, items]
properties:
warehouseId: {type: integer, format: int64, minimum: 1}
containerNo: {type: string, maxLength: 64}
expectedVersion: {type: integer, minimum: 0}
inventorySnapshotToken: {type: string, minLength: 64, maxLength: 64}
items:
type: array
minItems: 1
@@ -122,3 +133,36 @@ components:
expectedTaskVersion: {type: integer, minimum: 0}
operationId: {type: string, maxLength: 128}
remark: {type: string, maxLength: 500}
InventorySnapshot:
type: object
required: [taskId, taskVersion, containerNo, warehouseId, capturedAt, snapshotToken, inbounds]
properties:
taskId: {type: integer, format: int64}
taskVersion: {type: integer, minimum: 0}
containerNo: {type: string}
warehouseId: {type: integer, format: int64}
capturedAt: {type: string, format: date-time}
snapshotToken: {type: string, minLength: 64, maxLength: 64}
inbounds:
type: array
items: {$ref: '#/components/schemas/InboundInventory'}
InboundInventory:
type: object
required: [inboundId, availablePackageCount, resources]
properties:
inboundId: {type: integer, format: int64}
availablePackageCount: {type: integer, minimum: 0}
resources:
type: array
items: {$ref: '#/components/schemas/InventoryResource'}
InventoryResource:
type: object
required: [reservationId, occupancyId, palletId, locationId, sharedOverflow, availablePackageCount]
properties:
reservationId: {type: integer, format: int64}
occupancyId: {type: integer, format: int64}
palletId: {type: integer, format: int64}
locationId: {type: integer, format: int64}
locationCode: {type: string, nullable: true}
sharedOverflow: {type: boolean}
availablePackageCount: {type: integer, minimum: 1}