Skip to content

Analytics API ​

Implementation: front/src/services/api/analyticsService.ts and dashboardService.ts. All listed methods issue GET requests through the shared client. See API overview for common headers and 401 handling.

GET /analytics ​

  • Called from: Analytics page after settings/default currency loads and when period or currency changes.
  • Query: optional startDate, endDate, status, currency, assetType, entity.
  • Response type: ApiResponse<AnalyticsData>; analytics page consumes data when present.
  • Error: service logs/rethrows; page displays failure message and Retry. Other status contract unavailable.
  • Example: GET {VITE_API_BASE_URL}/analytics?currency=USD

GET /analytics/summary ​

  • Called from: Dashboard for selected currency; also exposed by analytics service.
  • Query: optional currency in dashboard service; currency string in analytics summary service.
  • Response types: dashboard uses DashboardSummary; analytics service declares AnalyticsSummary. Dashboard consumes current/previous liability and ROU metrics, lease counts, activity, and payment indicators.
  • Error: dashboard catches, displays error, and provides Retry. Backend response schema must be verified.
  • Example: GET {VITE_API_BASE_URL}/analytics/summary?currency=USD

GET /analytics/performance ​

  • Called from: analyticsService.getPortfolioPerformance; page call site not confirmed.
  • Query: optional startDate, endDate, status, currency, assetType, entity.
  • Response type: ApiResponse<PortfolioPerformance>; service type has roi, costSavings, efficiency, compliance.
  • Error: service logs and rethrows.
  • Example: GET {VITE_API_BASE_URL}/analytics/performance?currency=USD

GET /analytics/filters ​

  • Called from: analyticsService.getAnalyticsFilters; page call site not confirmed.
  • Response type: ApiResponse<any>.
  • Error: service logs and rethrows.
  • Exact response fields: Not available from frontend source code. Backend/API contract verification required.
  • Example: GET {VITE_API_BASE_URL}/analytics/filters