package dev.lions.unionflow.client.service;

import dev.lions.unionflow.server.api.dto.reference.request.*;
import dev.lions.unionflow.server.api.dto.reference.response.*;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
import java.util.List;
import java.util.UUID;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders;

/**
 * REST client pour le catalogue des types d'organisation (références).
 */
@RegisterRestClient(configKey = "unionflow-api")
@RegisterClientHeaders(dev.lions.unionflow.client.security.AuthHeaderFactory.class)
@Path("/api/references/types-organisation")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public interface TypeOrganisationClientService {

    @GET
    List<TypeReferenceResponse> list(@QueryParam("onlyActifs") @DefaultValue("true") boolean onlyActifs);

    @POST
    TypeReferenceResponse create(CreateTypeReferenceRequest request);

    @PUT
    @Path("/{id}")
    TypeReferenceResponse update(@PathParam("id") UUID id, UpdateTypeReferenceRequest request);

    @DELETE
    @Path("/{id}")
    void disable(@PathParam("id") UUID id);
}


