feat(selfop): add operating dashboard and preserve drilldown context

This commit is contained in:
2026-10-13 00:45:41 +08:00
parent cd3a32f372
commit b73dc0d410
18 changed files with 709 additions and 14 deletions
@@ -5,6 +5,13 @@ const http = vi.hoisted(() => ({ get: vi.fn(), post: vi.fn() }))
vi.mock('@/shared/api/http', () => ({ http, unwrapApiResponse: (value: { data: unknown }) => value.data }))
beforeEach(() => { vi.clearAllMocks(); http.get.mockResolvedValue({ data: {} }); http.post.mockResolvedValue({ data: { taskNo: 'COL-001', status: 'QUEUED' } }) })
describe('self-operated platform transport contract', () => {
it('keeps dashboard business aggregation separate from sync-overview runtime polling', async () => {
const params = { sourceAccount: 'lingxing-primary', warehouseCode: 'WH-A', rangePreset: 'LAST_15_DAYS' as const, salesRunId: '11', inventoryRunId: '12', queryAsOf: '2026-10-13T00:00:00Z' }
await analyticsApi.dashboard(params)
expect(http.get).toHaveBeenCalledWith('/platform/v1/last-leg/self-operated-analytics/dashboard', { params, signal: undefined })
expect(params).not.toHaveProperty('customerCode')
expect(params).not.toHaveProperty('current')
})
it('uses local fixed-version owners, owner overview and inventory attention endpoints', async () => {
const fixed = { sourceAccount: 'lingxing-primary', warehouseCode: 'WH-A', salesRunId: '11', inventoryRunId: '12', queryAsOf: '2026-10-12T01:00:00Z' }
await analyticsApi.owners({ ...fixed, keyword: 'OWNER_', current: 2, size: 20 })