This commit is contained in:
2026-08-05 09:11:48 +08:00
parent db8774627e
commit 3ffa7ec55f
11 changed files with 141 additions and 41 deletions
+4 -4
View File
@@ -23,7 +23,7 @@ describe('platform inbound query API', () => {
it('uses the implemented non-v1 list path and normalizes page values and IDs', async () => {
vi.mocked(http.get).mockResolvedValue({
code: '200', message: 'success', data: {
records: [{ id: 19001, orderId: 18001, customerId: 10001, totalPackageCount: '6', holdFlag: 'false' }],
records: [{ id: 19001, tenantId: 10002, orderId: 18001, customerId: 10001, totalPackageCount: '6', holdFlag: 'false' }],
page: '1', size: '20', total: '1', pages: '1',
},
})
@@ -31,7 +31,7 @@ describe('platform inbound query API', () => {
await expect(listPlatformInbounds('10001', {
page: 1, size: 20, tab: 'WAIT_MEASURE', inboundCode: 'RK', holdFlag: false,
})).resolves.toMatchObject({
records: [{ id: '19001', orderId: '18001', customerId: '10001', totalPackageCount: 6, holdFlag: false }],
records: [{ id: '19001', tenantId: '10002', orderId: '18001', customerId: '10001', totalPackageCount: 6, holdFlag: false }],
total: 1, pages: 1,
})
expect(http.get).toHaveBeenCalledWith('/platform/inbounds', {
@@ -42,14 +42,14 @@ describe('platform inbound query API', () => {
it('loads a tenant-scoped aggregate detail and keeps nested IDs as strings', async () => {
vi.mocked(http.get).mockResolvedValue({
code: '200', message: 'success', data: {
summary: { id: 19001, orderId: 18001 }, publicRemark: null,
summary: { id: 19001, tenantId: 10002, orderId: 18001 }, publicRemark: null,
palletLocations: [{ palletId: 21001, locationId: 22001 }], files: [{ fileId: 23001, uploadedBy: 2 }],
internalNotes: [{ id: 24001, createdBy: 2 }], statusHistory: [{ operatorId: 2 }],
},
})
await expect(getPlatformInbound('10001', '19001')).resolves.toMatchObject({
summary: { id: '19001', orderId: '18001' },
summary: { id: '19001', tenantId: '10002', orderId: '18001' },
palletLocations: [{ palletId: '21001', locationId: '22001' }],
files: [{ fileId: '23001', uploadedBy: '2' }],
internalNotes: [{ id: '24001', createdBy: '2' }],