package dev.lions.unionflow.client.service;

import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
import java.util.List;
import java.util.UUID;

/**
 * Service REST client pour l'export des données
 */
@RegisterRestClient(configKey = "unionflow-api")
@RegisterClientHeaders(dev.lions.unionflow.client.security.AuthHeaderFactory.class)
@Path("/api/export")
@Consumes(MediaType.APPLICATION_JSON)
public interface ExportClientService {
    
    @GET
    @Path("/cotisations/csv")
    @Produces("text/csv")
    byte[] exporterCotisationsCSV(
        @QueryParam("statut") String statut,
        @QueryParam("type") String type,
        @QueryParam("associationId") UUID associationId
    );
    
    @POST
    @Path("/cotisations/csv")
    @Produces("text/csv")
    byte[] exporterCotisationsSelectionneesCSV(List<UUID> cotisationIds);
    
    @GET
    @Path("/cotisations/{cotisationId}/recu")
    @Produces("text/plain")
    byte[] genererRecu(@PathParam("cotisationId") UUID cotisationId);
    
    @POST
    @Path("/cotisations/recus")
    @Produces("text/plain")
    byte[] genererRecusGroupes(List<UUID> cotisationIds);
    
    @GET
    @Path("/rapport/mensuel")
    @Produces("text/plain")
    byte[] genererRapportMensuel(
        @QueryParam("annee") int annee,
        @QueryParam("mois") int mois,
        @QueryParam("associationId") UUID associationId
    );
}

