package dev.lions.user.manager.client.api;

import dev.lions.user.manager.client.filter.AuthHeaderFactory;
import dev.lions.user.manager.dto.sync.HealthStatusDTO;
import dev.lions.user.manager.dto.sync.SyncResultDTO;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;

@RegisterRestClient(configKey = "user-api")
@RegisterClientHeaders(AuthHeaderFactory.class)
@Path("/api/sync")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public interface SyncRestClient {

    @POST
    @Path("/{realmName}/users")
    void syncUsers(@PathParam("realmName") String realmName);

    @POST
    @Path("/{realmName}/roles")
    void syncRoles(@PathParam("realmName") String realmName);

    @POST
    @Path("/{realmName}/all")
    SyncResultDTO syncAll(@PathParam("realmName") String realmName);

    @GET
    @Path("/health")
    HealthStatusDTO getHealthStatus();
}
