Skip to content

Commit

Permalink
ajout de getBudgets sorted
Browse files Browse the repository at this point in the history
  • Loading branch information
vzwingma committed Jun 6, 2024
1 parent 6ee3b17 commit 87d1b83
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.github.vzwingma.finances.budget.services.communs.data.trace.BusinessTraceContext;
import io.github.vzwingma.finances.budget.services.communs.data.trace.BusinessTraceContextKeyEnum;
import io.github.vzwingma.finances.budget.services.communs.utils.exceptions.BudgetNotFoundException;
import io.quarkus.panache.common.Sort;
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.Uni;
import jakarta.enterprise.context.ApplicationScoped;
Expand Down Expand Up @@ -91,14 +92,14 @@ public Uni<BudgetMensuel> chargeBudgetMensuel(String idBudget) {
@Override
public Multi<BudgetMensuel> chargeBudgetsMensuels(String idCompte){
LOGGER.info("Chargement des budgets ");
return find(ATTRIBUT_COMPTE_ID + "=?1", idCompte)
return find(ATTRIBUT_COMPTE_ID + "=?1", idCompte, Sort.by("id"))
.stream()
.onFailure()
.transform(e -> {
LOGGER.error("Erreur lors du chargement des budgets de {}", idCompte, e);
return new BudgetNotFoundException("Erreur lors du chargement des budgets " + idCompte);
})
.invoke(budget -> LOGGER.debug("-> Réception du budget {}. {} opérations", budget.getId(), budget.getListeOperations().size()));
.transform(e -> {
LOGGER.error("Erreur lors du chargement des budgets de {}", idCompte, e);
return new BudgetNotFoundException("Erreur lors du chargement des budgets " + idCompte);
})
.invoke(budget -> LOGGER.debug("-> {} : {} opérations", budget.getId(), budget.getListeOperations().size()));
}

/**
Expand Down

0 comments on commit 87d1b83

Please sign in to comment.