package dev.lions.unionflow.client.service;

import dev.lions.unionflow.server.api.dto.solidarite.request.CreateDemandeAideRequest;
import dev.lions.unionflow.server.api.dto.solidarite.response.DemandeAideResponse;
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;

@RegisterRestClient(configKey = "unionflow-api")
@RegisterClientHeaders(dev.lions.unionflow.client.security.AuthHeaderFactory.class)
@Path("/api/demandes-aide")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public interface DemandeAideService {
    
    @GET
    List<DemandeAideResponse> listerToutes(
        @QueryParam("page") @DefaultValue("0") int page,
        @QueryParam("size") @DefaultValue("20") int size
    );
    
    @GET
    @Path("/{id}")
    DemandeAideResponse obtenirParId(@PathParam("id") UUID id);
    
    @GET
    @Path("/search")
    List<DemandeAideResponse> rechercher(
        @QueryParam("statut") String statut,
        @QueryParam("type") String type,
        @QueryParam("urgence") String urgence,
        @QueryParam("page") @DefaultValue("0") int page,
        @QueryParam("size") @DefaultValue("20") int size
    );
    
    @POST
    DemandeAideResponse creer(CreateDemandeAideRequest request);
    
    @PUT
    @Path("/{id}")
    DemandeAideResponse modifier(@PathParam("id") UUID id, DemandeAideResponse demande);
    
    @DELETE
    @Path("/{id}")
    void supprimer(@PathParam("id") UUID id);
    
    @PUT
    @Path("/{id}/approuver")
    DemandeAideResponse approuver(@PathParam("id") UUID id);
    
    @PUT
    @Path("/{id}/rejeter")
    DemandeAideResponse rejeter(@PathParam("id") UUID id);
}

