feat(appointment): complete customer receiving and trip continuation workflows

This commit is contained in:
2026-10-16 15:41:56 +08:00
parent 148085286d
commit 45f662ecf2
45 changed files with 2042 additions and 131 deletions
@@ -1,10 +1,16 @@
import { beforeEach, expect, it, vi } from 'vitest'
import { http } from '@/shared/api/http'
import { getWorkCalendar, getWorkSummary, getWorkItems, getWorkDetail, submitWorkCommand } from './workApi'
import { getWorkCalendar, getWorkSummary, getWorkItems, getWorkDetail, submitWorkCommand, resolveBatchWork } from './workApi'
import { getCargoVerification, saveCargoVerification } from './cargoVerificationApi'
import { workCalendar, workDetail, workItem, workSummary } from './work.test-support'
vi.mock('@/shared/api/http', () => ({ http: { get: vi.fn(), post: vi.fn() }, unwrapApiResponse: <T>(value: { data: T }) => value.data }))
beforeEach(() => vi.clearAllMocks())
it('resolves a real batch and optional customer without manufacturing a work key', async () => {
const resolved = { batchKey: 'FBA_APPOINTMENT:40', customerId: '9007199254740999', detail: workDetail(), candidates: [] }
vi.mocked(http.get).mockResolvedValue({ data: resolved })
expect(await resolveBatchWork(resolved.batchKey, resolved.customerId)).toEqual(resolved)
expect(http.get).toHaveBeenCalledWith('/platform/v1/last-leg/appointment-work/items/resolve', { params: { batchKey: resolved.batchKey, customerId: resolved.customerId }, signal: undefined })
})
it('uses inclusive calendar dates and repeated type parameters with no duplicate API prefix', async () => {
vi.mocked(http.get).mockResolvedValue({ data: workCalendar })
const signal = new AbortController().signal