Skip to content

Commit

Permalink
fix Stripe transfer sumary
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminpochat committed Nov 15, 2024
1 parent d4d8d08 commit caf38f1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<BalanceTransaction> getBalanceTransations() {
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/src/layouts/producer/AnonymousLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function AnonymousLayout() {
</Box>

<Box sx={functionDescriptionStyle}>
<Typography variant='h5'>Gestion du stock simplifié</Typography>
<Typography variant='h5'>Gestion du stock simplifiée</Typography>
<i style={{width:'3rem', height:'3rem'}} className="icon stock-availability-icon"></i>
</Box>

Expand Down

0 comments on commit caf38f1

Please sign in to comment.