feat(admin): edit domestic order declarations

This commit is contained in:
2026-09-02 10:24:07 +08:00
parent 132d0c22d7
commit bbb9c40c50
8 changed files with 432 additions and 5 deletions
@@ -8,6 +8,7 @@ import {
downloadPlatformProductImage,
listPlatformUnifiedOrders,
listPlatformUnifiedOrderFeeDetails,
updatePlatformUnifiedOrderDeclaration,
} from './unifiedOrders'
vi.mock('@/shared/api/http', () => ({
@@ -147,6 +148,18 @@ describe('unified orders API contract', () => {
expect(http.post).toHaveBeenCalledWith('/platform/v1/orders/90001/internal-notes', { content: '已确认船期' }, { params: { tenantId: '208' } })
})
it('updates customer declaration fields through the versioned tenant-scoped contract', async () => {
const request = {
expectedVersion: 7, customerRemark: '易碎', expectedArrivalAt: '2026-09-06T10:00:00',
channelCode: 'US-SEA', channelName: '美西海运',
cargoes: [{ itemNo: 1, cargoName: '台灯', packageCount: 2, totalQuantity: 20, lengthCm: 40, widthCm: 30, heightCm: 20, grossWeightKg: 18, volumeCbm: 0.048 }],
}
vi.mocked(http.put).mockResolvedValue({ data: { orderNo: 'FL-1', inboundCode: 'RK-1', previousVersion: 7, version: 8, channelChangedBefore: false, channelChanged: true, changes: [] } })
await expect(updatePlatformUnifiedOrderDeclaration('208', '90001', request)).resolves.toMatchObject({ version: 8, channelChanged: true })
expect(http.put).toHaveBeenCalledWith('/platform/v1/orders/90001/declaration', request, { params: { tenantId: '208' } })
})
it('loads fee detail rows from the inbound fee-detail contract', async () => {
vi.mocked(http.get).mockResolvedValue({ data: [{ id: '1', inboundId: '88', reviewStatus: 'APPROVED', amount: 100 }] })
await expect(listPlatformUnifiedOrderFeeDetails('208', '88')).resolves.toHaveLength(1)