package infrastructure.client.otp.api;

import infrastructure.interceptor.LoggingFilter;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.HeaderParam;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam;
import org.eclipse.microprofile.rest.client.annotation.RegisterProvider;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
import org.jboss.resteasy.reactive.RestResponse;

@RegisterRestClient(configKey = "otp")
@RegisterProvider(LoggingFilter.class)
public interface OtpClient {
    @GET
    @ClientHeaderParam(name = "appId", value = "${app.appId}")
    @Path("/{otpToken}/{appOrigen}/{login}/{ipAddress}/{canal}/{servicio}")
    RestResponse<Void> validateOtp(
            @HeaderParam("requestId") String requestId,
            @PathParam("otpToken") String otpToken,
            @PathParam("appOrigen") String appOrigen,
            @PathParam("login") String login,
            @PathParam("ipAddress") String ipAddress,
            @PathParam("canal") String canal,
            @PathParam("servicio") String servicio
    );
}