This commit is contained in:
2026-10-14 00:07:05 +08:00
parent 4c4a3db1eb
commit 2cf9129606
16 changed files with 592 additions and 20 deletions
@@ -1,4 +1,5 @@
import { http, unwrapApiResponse, type ApiEnvelope } from '@/shared/api/http'
import type { TurnoverQuery, TurnoverResponse } from '../turnoverTypes'
import type { BusinessPage, BusinessQuery, Dashboard, DashboardQuery, DailyResponse, InventoryMetric, InventoryQuery, Metric, Overview, OwnerOption, OwnerOverview, OwnerOverviewQuery, OwnerQuery, RetryCommand, RetryResult, Run, RuntimePage, RuntimeQuery, SalesSummary, Scope, TaskDetail } from '../types'
const base = '/platform/v1/last-leg/self-operated-analytics'
@@ -7,6 +8,7 @@ async function get<T>(path: string, params: object, signal?: AbortSignal): Promi
return unwrapApiResponse(response)
}
export const analyticsApi = {
turnover: (query: TurnoverQuery, signal?: AbortSignal) => get<TurnoverResponse>('inventory-turnover', query, signal),
dashboard: (query: DashboardQuery, signal?: AbortSignal) => get<Dashboard>('dashboard', query, signal),
owners: (query: OwnerQuery, signal?: AbortSignal) => get<BusinessPage<OwnerOption>>('owners', query, signal),
ownerOverview: (query: OwnerOverviewQuery, signal?: AbortSignal) => get<OwnerOverview | null>('owner-overview', query, signal),