NOTE: This is a technical subticket of T328075: Move tracking out of donation data blob
This ticket is about changing the "Donations per Day" report to query the database for donations with matching campaign and keywords instead of iterating over donations and checking the tracking data in PHP.
Affected repositories
- Fundraising Operation Center
Implementation details
A quick refactoring would be to use the DonationReportFetcher from T338511: Create DonationReportFetcher and remove the check with CampaignDataMatcher.
A more complex, but efficient refactoring would be to do the aggregation, average and count in a SQL query and group by date and payment type. This would get rid of a lot of PHP code
The tests should pass right away with the changes from T338509: Adapt donation fixtures for tests