feat(overseas): manage last-mile order controls

This commit is contained in:
2026-09-08 10:54:36 +08:00
parent 74d883a443
commit 463b054a0a
7 changed files with 73 additions and 33 deletions
@@ -87,12 +87,15 @@ describe('last-mile order overseas API', () => {
it('uses the manual inbound-plan endpoint with the complete form and idempotency evidence', async () => {
vi.mocked(overseasHttp.post).mockResolvedValue({ code: '200', message: 'success', data: {} })
const payload = { orderId: '190000000000000099', customerId: '190000000000000001', expectedOrderVersion: 4,
plannedWarehouseId: '193000000000200003', plannedWarehouseCode: 'US-LAX-01', plannedWarehouseName: '洛杉矶仓',
plannedArrivalDate: '2026-09-08', inboundCode: 'NYEXX2609060063', palletCount: 8, palletType: 'STANDARD' as const,
plannedArrivalDate: '2026-09-08', palletCount: 8, palletType: 'STANDARD' as const,
assigned: false, mergeRequired: false, urgent: true, remark: '加急' }
await createManualInboundPlan(payload, 'plan-key-1')
expect(overseasHttp.post).toHaveBeenCalledWith('/platform/v1/last-leg/inbound-plans/manual', payload,
{ headers: { 'Idempotency-Key': 'plan-key-1' } })
expect(payload).not.toHaveProperty('inboundCode')
expect(payload).not.toHaveProperty('plannedWarehouseId')
expect(payload).not.toHaveProperty('plannedWarehouseCode')
expect(payload).not.toHaveProperty('plannedWarehouseName')
})
it('uses versioned idempotent order hold and complete manual-node snapshot endpoints', async () => {
@@ -52,6 +52,8 @@ export interface LastMileOrderSummaryDto {
sourceOrderNo?: string | null
sourceInboundId?: string | null
customerName?: string | null
overseasWarehouseId?: string | null
overseasWarehouseCode?: string | null
overseasWarehouseName?: string | null
transferWarehouseName?: string | null
transferWarehouseId?: string | null
@@ -224,11 +226,7 @@ export interface ManualInboundPlanPayload {
customerId: string
orderId: string
expectedOrderVersion: number
plannedWarehouseId: string
plannedWarehouseCode: string
plannedWarehouseName: string
plannedArrivalDate: string
inboundCode: string
palletCount: number
palletType: 'STANDARD' | 'WOOD' | 'PAPER'
assigned: boolean