Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

donations/exportToExcel: Add values for missing payment columns #609

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/api/src/donations/donations.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import { CreateSessionDto } from './dto/create-session.dto'
import { UpdatePaymentDto } from './dto/update-payment.dto'

import { DonationBaseDto, ListDonationsDto } from './dto/list-donations.dto'

Check warning on line 27 in apps/api/src/donations/donations.service.ts

View workflow job for this annotation

GitHub Actions / Run API tests

'DonationBaseDto' is defined but never used
import { donationWithPerson } from './queries/donation.validator'
import { CreateStripePaymentDto } from './dto/create-stripe-payment.dto'
import { ImportStatus } from '../bank-transactions-file/dto/bank-transactions-import-status.dto'
Expand Down Expand Up @@ -903,6 +903,11 @@
: 'Anonymous Donor',
email: donation.person ? donation.person.email : '',
campaignId: donation.targetVault.campaign.id,
status: donation.payment.status,
provider: donation.payment.provider,
currency: donation.payment.currency,
billingName: donation.payment.billingName,
billingEmail: donation.payment.billingEmail,
}))

const donationExcelTemplate = getTemplateByTable('donations')
Expand Down
10 changes: 10 additions & 0 deletions apps/api/src/donations/queries/donation.validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ export const donationWithPerson = Prisma.validator<Prisma.DonationFindManyArgs>(
email: true,
},
},
payment: {
select: {
id: true,
status: true,
provider: true,
currency: true,
billingEmail: true,
billingName: true,
},
},
targetVault: {
select: {
name: true,
Expand Down
Loading