优化
This commit is contained in:
@@ -7,8 +7,8 @@ const group = {
|
||||
warehouseId: 2093000000000000002n, channelCode: 'NY-EXX', lockedPlanId: null,
|
||||
version: 0, fullPackageCount: 18, createdAt: '2026-08-29T10:00:00', updatedAt: '2026-08-29T10:00:00',
|
||||
members: [
|
||||
{ tenantId: 2093000000000000004n, orderId: 2093000000000000005n, inboundId: 2093000000000000006n, fullPackageCount: 8 },
|
||||
{ tenantId: 2093000000000000007n, orderId: 2093000000000000008n, inboundId: 2093000000000000009n, fullPackageCount: 10 },
|
||||
{ tenantId: 2093000000000000004n, orderId: 2093000000000000005n, inboundId: 2093000000000000006n, inboundCode: 'NYEXX2608310001', fullPackageCount: 8 },
|
||||
{ tenantId: 2093000000000000007n, orderId: 2093000000000000008n, inboundId: 2093000000000000009n, inboundCode: 'NYEXX2608310002', fullPackageCount: 10 },
|
||||
],
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ describe('co-load group API', () => {
|
||||
expect(result.groupId).toBe('2093000000000000001')
|
||||
expect(result.members.map((member) => member.orderId)).toEqual(orderIds)
|
||||
expect(result.members.map((member) => member.tenantId)).toEqual(['2093000000000000004', '2093000000000000007'])
|
||||
expect(result.members.map((member) => member.inboundCode)).toEqual(['NYEXX2608310001', 'NYEXX2608310002'])
|
||||
})
|
||||
|
||||
it('cancels only the whole group with optimistic version and an optional reason', async () => {
|
||||
@@ -48,7 +49,7 @@ describe('co-load group API', () => {
|
||||
})
|
||||
|
||||
it('keeps every inbound fragment when one order has multiple current inbounds', async () => {
|
||||
const fragment = { ...group.members[0], inboundId: 2093000000000000012n, fullPackageCount: 3 }
|
||||
const fragment = { ...group.members[0], inboundId: 2093000000000000012n, inboundCode: 'NYEXX2608310001-B', fullPackageCount: 3 }
|
||||
const multiInboundGroup = { ...group, fullPackageCount: 21, members: [group.members[0], fragment, group.members[1]] }
|
||||
const post = vi.spyOn(http, 'post').mockResolvedValue({ code: '200', message: 'ok', data: [
|
||||
{ orderId: group.members[0].orderId, group: multiInboundGroup },
|
||||
@@ -57,9 +58,9 @@ describe('co-load group API', () => {
|
||||
const result = await batchQueryPlatformCoLoadGroups(['2093000000000000005', '2093000000000000008'])
|
||||
expect(post).toHaveBeenCalledTimes(1)
|
||||
expect(result[0].group.members).toEqual([
|
||||
expect.objectContaining({ orderId: '2093000000000000005', inboundId: '2093000000000000006', fullPackageCount: 8 }),
|
||||
expect.objectContaining({ orderId: '2093000000000000005', inboundId: '2093000000000000012', fullPackageCount: 3 }),
|
||||
expect.objectContaining({ orderId: '2093000000000000008', inboundId: '2093000000000000009', fullPackageCount: 10 }),
|
||||
expect.objectContaining({ orderId: '2093000000000000005', inboundId: '2093000000000000006', inboundCode: 'NYEXX2608310001', fullPackageCount: 8 }),
|
||||
expect.objectContaining({ orderId: '2093000000000000005', inboundId: '2093000000000000012', inboundCode: 'NYEXX2608310001-B', fullPackageCount: 3 }),
|
||||
expect.objectContaining({ orderId: '2093000000000000008', inboundId: '2093000000000000009', inboundCode: 'NYEXX2608310002', fullPackageCount: 10 }),
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
@@ -6,6 +6,7 @@ export interface CoLoadGroupMember {
|
||||
tenantId: string
|
||||
orderId: string
|
||||
inboundId: string
|
||||
inboundCode: string
|
||||
fullPackageCount: number
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user