Skip to content

Commit

Permalink
Filter out agreements with 0 amount from scheduled avtalegiro
Browse files Browse the repository at this point in the history
  • Loading branch information
fellmirr committed Oct 9, 2024
1 parent 9f371aa commit 68d1bda
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/routes/scheduled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ router.post("/avtalegiro", authMiddleware.isAdmin, async (req, res, next) => {
if (isClaimDateLastDayOfMonth) {
agreements = [...agreements, ...(await DAO.avtalegiroagreements.getByPaymentDate(0))];
}
agreements = agreements.filter((agreement) => agreement.amount > 0);

if (agreements.length > 0) {
/**
Expand Down Expand Up @@ -209,6 +210,7 @@ router.post("/avtalegiro/retry", authMiddleware.isAdmin, async (req, res, next)
agreements = [...agreements, ...(await DAO.avtalegiroagreements.getByPaymentDate(0))];
}

agreements = agreements.filter((agreement) => agreement.amount > 0);
if (agreements.length > 0) {
/**
* Notify agreements to be charged
Expand Down

0 comments on commit 68d1bda

Please sign in to comment.