Page MenuHomePhabricator

Refactor getDonationSumPerDay Report
Open, Needs TriagePublic

Description

This is only report that still uses the legacy database abstraction Report model. It exports the data into a CSV instead of a data structure.

Implementation Details:

  1. Add an acceptance (GoldenMaster) test that checks the CSV output for a given set of donations. The test should insert a larger donation data set to make sure you don't break anything. You can use a SQL file from tests/fixtures/Analysis
  2. Refactor the Report to use a Doctrine DBAL connection. Using a query builder will probably be best. You can copy-paste the code that builds the report data structure and change the tracking handling later
  3. Change the donation query to include the tracking table and query the given campaigns and keywords in the WHERE clause. Remove the if checks in the while loop (currently in lines 40-50 of Report.php)
  4. Copy the refactored class to src (removing the inheritance from Report ) and create a new RouteHandler (i.e. Controller) in app/RouteHandlers that uses code from application/controller/Backend/ExportController.php (without SingletonFactory) to create the result. Add an explicit route in RouteFactory, add to route to the list of reports in templates/reports_overview.html.twig and remove the special handling of this report (if statement in lines 135-139, rawData attribute in HTML)
  5. Delete application/controller/Backend/ExportController.php and application/model/Report.php

Event Timeline

gabriel-wmde renamed this task from ## Refactor getDonationSumPerDay Report to Refactor getDonationSumPerDay Report.Jun 8 2023, 8:54 PM
gabriel-wmde created this task.