import { dashboardPayload } from '@/services/mock-data'
import { apiGet, isMockApiEnabled, mockResponse, type ServiceRequestOptions } from '@/services/api-client'
import type { DashboardPayload } from '@/types/domain'

export const dashboardService = {
  getDashboard: async (options: ServiceRequestOptions = {}): Promise<DashboardPayload> => {
    if (isMockApiEnabled()) {
      return mockResponse('/api/v1/dashboard', () => dashboardPayload, options)
    }

    return apiGet<DashboardPayload>('/api/v1/dashboard')
  },
}
