package dev.lions.unionflow.client.service;

import dev.lions.unionflow.server.api.dto.config.request.*;
import dev.lions.unionflow.server.api.dto.config.response.*;
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;

/**
 * Service REST client pour la gestion de la configuration système
 *
 * @author UnionFlow Team
 * @version 1.0
 */
@RegisterRestClient(configKey = "unionflow-api")
@RegisterClientHeaders(dev.lions.unionflow.client.security.AuthHeaderFactory.class)
@Path("/api/configuration")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public interface ConfigurationService {

    @GET
    List<ConfigurationResponse> listerConfigurations();

    @GET
    @Path("/{cle}")
    ConfigurationResponse obtenirConfiguration(@PathParam("cle") String cle);

    @PUT
    @Path("/{cle}")
    ConfigurationResponse mettreAJourConfiguration(@PathParam("cle") String cle, UpdateConfigurationRequest request);
}

