Implement Store analytics and api integrations

This commit is contained in:
2026-10-08 16:32:23 +05:30
parent 4e12b03e4b
commit e5f6aa15b9
9 changed files with 1367 additions and 80 deletions
+3
View File
@@ -4,6 +4,7 @@ import type {
StoreResponse,
OutstandingBalanceResponse,
StoreDashboardResponse,
StoreAnalyticsResponse,
StoreVisitHistoryItem,
} from '@/types/api'
@@ -51,6 +52,8 @@ export const stores = {
dashboard: (id: string, period?: string) =>
api.get<StoreDashboardResponse>(`/stores/${id}/dashboard`, { params: { period } }).then(r => r.data),
analytics: (id: string, months = 12) =>
api.get<StoreAnalyticsResponse>(`/stores/${id}/analytics`, { params: { months } }).then(r => r.data),
visitHistory: (id: string) =>
api.get<StoreVisitHistoryItem[]>(`/stores/${id}/visit-history`).then(r => r.data),
}