package dev.lions.unionflow.client.service;

import dev.lions.unionflow.server.api.dto.dashboard.DashboardDataResponse;
import dev.lions.unionflow.server.api.dto.dashboard.DashboardStatsResponse;
import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
import java.util.Map;

/**
 * Service REST Client pour les APIs du dashboard
 * 
 * @author UnionFlow Team
 * @version 1.0
 */
@RegisterRestClient(configKey = "unionflow-api")
@RegisterClientHeaders(dev.lions.unionflow.client.security.AuthHeaderFactory.class)
@Path("/api/v1/dashboard")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public interface DashboardService {
    
    /**
     * Récupère toutes les données du dashboard
     */
    @GET
    @Path("/data")
    DashboardDataResponse getDashboardData(
        @QueryParam("organizationId") String organizationId,
        @QueryParam("userId") String userId
    );
    
    /**
     * Récupère uniquement les statistiques du dashboard
     */
    @GET
    @Path("/stats")
    DashboardStatsResponse getDashboardStats(
        @QueryParam("organizationId") String organizationId,
        @QueryParam("userId") String userId
    );
    
    /**
     * Récupère les activités récentes
     */
    @GET
    @Path("/activities")
    Map<String, Object> getRecentActivities(
        @QueryParam("organizationId") String organizationId,
        @QueryParam("userId") String userId,
        @QueryParam("limit") @DefaultValue("10") int limit
    );
    
    /**
     * Récupère les événements à venir
     */
    @GET
    @Path("/events/upcoming")
    Map<String, Object> getUpcomingEvents(
        @QueryParam("organizationId") String organizationId,
        @QueryParam("userId") String userId,
        @QueryParam("limit") @DefaultValue("5") int limit
    );
    
    /**
     * Rafraîchit les données du dashboard
     */
    @POST
    @Path("/refresh")
    Map<String, Object> refreshDashboard(
        @QueryParam("organizationId") String organizationId,
        @QueryParam("userId") String userId
    );
}

