fix: scope smart loading recommendation requests

This commit is contained in:
2026-09-14 17:22:08 +08:00
parent 7e29e6c25c
commit 22c755b02a
4 changed files with 42 additions and 6 deletions
@@ -5,6 +5,7 @@ import { http } from '@/shared/api/http'
import {
adjustSmartLoadingItem, assignPendingReviewSmartLoadingOrder, assignSmartLoadingGroup, assignSmartLoadingItem, assignSmartLoadingPallet, getContainer,
listContainers, listSmartLoadingCandidates, listSmartLoadingWorkbenchContainers, removeAllUnpickedSmartLoadingItems, removeSmartLoadingGroup, removeSmartLoadingItem, removeSmartLoadingPallet,
recommendSmartLoading,
getContainerClearance, downloadContainerClearance, uploadContainerClearance, completeContainerClearance,
getContainerOverview, updateContainerPickupCode, markContainerException, cancelContainerException, uploadContainerDocument, downloadContainerDocument, downloadContainerPdaPhoto,
getCustomerContainerTransitSummary,
@@ -131,6 +132,25 @@ describe('platform container loading API', () => {
)
})
it('limits smart recommendation to the current customer and inbound filters', async () => {
vi.mocked(http.post).mockResolvedValue({ code: '200', data: plan })
await recommendSmartLoading('10', 5, {
customerId: '9007199254740998',
inboundCode: ' EXXHWK2609140162 ',
})
expect(http.post).toHaveBeenCalledWith(
'/platform/v1/first-leg/smart-loading/plans/10/recommend',
expect.objectContaining({
expectedVersion: 5,
customerId: '9007199254740998',
inboundCode: 'EXXHWK2609140162',
operationId: expect.stringContaining('recommend-'),
}),
)
})
it('removes a sealed pallet through the whole-pallet command', async () => {
vi.mocked(http.delete).mockResolvedValue({ code: '200', data: plan })