feat(appointment): integrate work calendar and original business actions

This commit is contained in:
2026-10-15 17:11:03 +08:00
parent af2e1481a6
commit b769d2479c
59 changed files with 2604 additions and 941 deletions
@@ -1,6 +1,6 @@
import { expect, it, vi } from 'vitest'
import { http } from '@/shared/api/http'
import { listPlanningCargo, listPlanningContainers } from './planningApi'
import { listPlanningCargo, listPlanningContainers, resolvePlanningOrder } from './planningApi'
vi.mock('@/shared/api/http', () => ({ http: { get: vi.fn() }, unwrapApiResponse: <T>(value: { data: T }) => value.data }))
it('uses the gateway planning route and preserves stable source IDs and null predictions', async () => {
@@ -20,3 +20,10 @@ it('keeps basic container listing on its own endpoint rather than requiring impa
expect(http.get).toHaveBeenCalledExactlyOnceWith('/platform/v1/last-leg/appointment-planning/containers', { params: { page: 1, size: 20 }, signal: undefined })
expect(result.total).toBe(0)
})
it('resolves an order through the real canonical-source endpoint without fabricating an ORDER alias', async () => {
vi.mocked(http.get).mockClear()
vi.mocked(http.get).mockResolvedValue({data:{source:{sourceKey:'BOOKING:B-1'},coverage:{appointments:[]}}})
const query = {orderId:'9007199254740993',customerId:'customer-a',destinationKey:'FBA:ONT8'}
expect((await resolvePlanningOrder(query)).source.sourceKey).toBe('BOOKING:B-1')
expect(http.get).toHaveBeenCalledExactlyOnceWith('/platform/v1/last-leg/appointment-planning/sources/resolve-order',{params:query})
})