This commit is contained in:
2026-08-13 12:22:41 +08:00
parent 835ac0ad12
commit 8a8c4fa190
26 changed files with 572 additions and 148 deletions
@@ -1,6 +1,7 @@
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { http } from '@/shared/api/http'
import {
getPlatformTenantOrderStatistics,
acceptPlatformFirstLegOrder,
addPlatformFirstLegOrderNote,
approvePlatformFirstLegOrder,
@@ -24,6 +25,15 @@ describe('platform first-leg order API', () => {
vi.mocked(http.put).mockReset()
})
it('uses the submitted master-order statistics contract and preserves the long customer id', async () => {
vi.mocked(http.get).mockResolvedValue({ code: '200', data: { tenantId: '9007199254740993', totalSubmittedOrders: 12, currentMonthSubmittedOrders: 3, monthStart: '2026-08-01T00:00:00+08:00', nextMonthStart: '2026-09-01T00:00:00+08:00', zoneId: 'Asia/Shanghai', asOf: '2026-08-13T12:00:00+08:00' } })
const result = await getPlatformTenantOrderStatistics('9007199254740993')
expect(http.get).toHaveBeenCalledWith('/platform/v1/orders/first-leg/tenant-statistics', { params: { tenantId: '9007199254740993' } })
expect(result).toMatchObject({ tenantId: '9007199254740993', totalSubmittedOrders: 12, currentMonthSubmittedOrders: 3, zoneId: 'Asia/Shanghai' })
})
it('queries the cross-tenant review queue with one server-paginated request', async () => {
const page = { records: [], page: 2, size: 20, total: 0, pages: 0 }
vi.mocked(http.get).mockResolvedValue({ code: '200', message: 'success', data: page })