package dev.lions.unionflow.client.service; import dev.lions.unionflow.server.api.dto.mutuelle.epargne.CompteEpargneRequest; import dev.lions.unionflow.server.api.dto.mutuelle.epargne.CompteEpargneResponse; import dev.lions.unionflow.server.api.dto.mutuelle.epargne.TransactionEpargneRequest; import dev.lions.unionflow.server.api.dto.mutuelle.epargne.TransactionEpargneResponse; import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; import jakarta.ws.rs.*; import jakarta.ws.rs.core.MediaType; import java.util.List; @RegisterRestClient(configKey = "unionflow-api") @RegisterClientHeaders(dev.lions.unionflow.client.security.AuthHeaderFactory.class) @Path("/api/v1/epargne") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public interface EpargneService { // --- Comptes --- @POST @Path("/comptes") CompteEpargneResponse ouvrirCompte(CompteEpargneRequest request); @GET @Path("/comptes/{id}") CompteEpargneResponse obtenirCompte(@PathParam("id") String id); @GET @Path("/comptes/mes-comptes") List obtenirMesComptes(); @GET @Path("/comptes/membre/{membreId}") List obtenirComptesParMembre(@PathParam("membreId") String membreId); @GET @Path("/comptes/organisation/{organisationId}") List obtenirComptesParOrganisation( @PathParam("organisationId") String organisationId, @QueryParam("page") @DefaultValue("0") int page, @QueryParam("size") @DefaultValue("20") int size ); @PATCH @Path("/comptes/{id}/statut") CompteEpargneResponse changerStatut( @PathParam("id") String id, @QueryParam("statut") String statut ); // --- Transactions --- @POST @Path("/transactions") TransactionEpargneResponse executerTransaction(TransactionEpargneRequest request); @POST @Path("/transactions/transfert") TransactionEpargneResponse effectuerTransfert(TransactionEpargneRequest request); @GET @Path("/transactions/compte/{compteId}") List obtenirTransactions( @PathParam("compteId") String compteId, @QueryParam("page") @DefaultValue("0") int page, @QueryParam("size") @DefaultValue("20") int size ); }