Skip to content

Commit

Permalink
change recurringdonation status to exclude failed (#1869)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosQ96 authored Nov 6, 2024
1 parent f6d7b3f commit d2b614d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/services/recurringDonationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,8 @@ export const recurringDonationsCountPerDateRange = async (
): Promise<number> => {
const query = RecurringDonation.createQueryBuilder('recurringDonation')
.select('COALESCE(COUNT(recurringDonation.id), 0)', 'count')
.where('recurringDonation.status = :status', {
status: RECURRING_DONATION_STATUS.ACTIVE,
.where('recurringDonation.status != :status', {
status: RECURRING_DONATION_STATUS.FAILED,
});

if (fromDate) {
Expand Down Expand Up @@ -477,8 +477,8 @@ export const recurringDonationsCountPerDateRangePerMonth = async (
const query = RecurringDonation.createQueryBuilder('recurringDonation')
.select('COUNT(recurringDonation.id)', 'total')
.addSelect("TO_CHAR(recurringDonation.createdAt, 'YYYY/MM')", 'date')
.where('recurringDonation.status = :status', {
status: RECURRING_DONATION_STATUS.ACTIVE,
.where('recurringDonation.status != :status', {
status: RECURRING_DONATION_STATUS.FAILED,
});

if (fromDate) {
Expand Down Expand Up @@ -672,8 +672,8 @@ export const recurringDonationsCountPerToken = async (params: {
const query = RecurringDonation.createQueryBuilder('recurringDonation')
.select('recurringDonation.currency', 'token')
.addSelect('COALESCE(COUNT(recurringDonation.id), 0)', 'total')
.where('recurringDonation.status = :status', {
status: RECURRING_DONATION_STATUS.ACTIVE,
.where('recurringDonation.status != :status', {
status: RECURRING_DONATION_STATUS.FAILED,
})
.groupBy('recurringDonation.currency')
.having('COUNT(recurringDonation.id) > 0');
Expand Down

0 comments on commit d2b614d

Please sign in to comment.