From caf38f1b4b1e05969caa80af793ec146ece8e124 Mon Sep 17 00:00:00 2001 From: Benjamin POCHAT Date: Fri, 15 Nov 2024 23:37:59 +0100 Subject: [PATCH] fix Stripe transfer sumary --- .gitignore | 1 + .../viandeendirect/domains/payment/StripeBalanceManager.java | 2 +- .../domains/payment/TestStripeBalanceManager.java | 4 ++-- frontend/app/src/layouts/producer/AnonymousLayout.tsx | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index dde7a4f..0ebf103 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ **/target/** backend/gen/.openapi-generator/** backend/gen/src/** +backend/app/src/main/resources/application-sandbox.properties frontend/gen/* frontend/app/build diff --git a/backend/app/src/main/java/eu/viandeendirect/domains/payment/StripeBalanceManager.java b/backend/app/src/main/java/eu/viandeendirect/domains/payment/StripeBalanceManager.java index 41d231d..e96ade8 100644 --- a/backend/app/src/main/java/eu/viandeendirect/domains/payment/StripeBalanceManager.java +++ b/backend/app/src/main/java/eu/viandeendirect/domains/payment/StripeBalanceManager.java @@ -47,7 +47,7 @@ private PaymentsSummary initPaymentsSummary() { } private void updatePaymentSummary(PaymentsSummary paymentsSummary, BalanceTransaction balanceTransaction, Instant oneDayAgo, Instant oneWeekAgo, Instant oneMonthAgo, Instant oneYearAgo) { - if (balanceTransaction.getType().equals("charge") && balanceTransaction.getStatus().equals("available")) { + if (balanceTransaction.getType().equals("charge")) { if (balanceTransaction.getCreated() > oneDayAgo.getEpochSecond()) { paymentsSummary.setDaylyTotal(paymentsSummary.getDaylyTotal() + balanceTransaction.getAmount() / 100); } diff --git a/backend/app/src/test/java/eu/viandeendirect/domains/payment/TestStripeBalanceManager.java b/backend/app/src/test/java/eu/viandeendirect/domains/payment/TestStripeBalanceManager.java index b9d39d0..9d881ee 100644 --- a/backend/app/src/test/java/eu/viandeendirect/domains/payment/TestStripeBalanceManager.java +++ b/backend/app/src/test/java/eu/viandeendirect/domains/payment/TestStripeBalanceManager.java @@ -26,8 +26,8 @@ void should_return_the_expected_result() throws StripeException { // then Assertions.assertThat(paymentsSummary.getDaylyTotal()).isEqualTo(1000f); Assertions.assertThat(paymentsSummary.getWeeklyTotal()).isEqualTo(1500f); - Assertions.assertThat(paymentsSummary.getMonthlyTotal()).isEqualTo(1700f); - Assertions.assertThat(paymentsSummary.getYearlyTotal()).isEqualTo(2400f); + Assertions.assertThat(paymentsSummary.getMonthlyTotal()).isEqualTo(2450f); + Assertions.assertThat(paymentsSummary.getYearlyTotal()).isEqualTo(3150f); } private Iterable getBalanceTransations() { diff --git a/frontend/app/src/layouts/producer/AnonymousLayout.tsx b/frontend/app/src/layouts/producer/AnonymousLayout.tsx index fd6cb9d..883ed5d 100644 --- a/frontend/app/src/layouts/producer/AnonymousLayout.tsx +++ b/frontend/app/src/layouts/producer/AnonymousLayout.tsx @@ -85,7 +85,7 @@ export default function AnonymousLayout() { - Gestion du stock simplifié + Gestion du stock simplifiée