package org.example.petshopdesktop.api.endpoints;

import org.example.petshopdesktop.api.ApiClient;
import org.example.petshopdesktop.api.dto.analytics.DashboardResponse;

public class AnalyticsApi {
    private static final AnalyticsApi INSTANCE = new AnalyticsApi();
    private final ApiClient apiClient;

    private AnalyticsApi() {
        this.apiClient = ApiClient.getInstance();
    }

    public static AnalyticsApi getInstance() {
        return INSTANCE;
    }

    public DashboardResponse getDashboard(int days, int top) throws Exception {
        String path = "/api/v1/analytics/dashboard?days=" + days + "&top=" + top;
        return apiClient.get(path, DashboardResponse.class);
    }
}
