Skip to content

fix: Report backend adjustments

Dat Nguyen requested to merge dat/fix/BB-6449_report_adjustment into master

Supporting information

BB-6449

Why

  • Some adjustments needed to be made for report generation API working properly

Changes

  • Allow compare runs of inactive recurrences (test included)
  • Fix the issue fetching CSV report of empty recurrence with checklist that has numeric task definition (test included)
  • Add a management command to allow admin user to trigger creating and recomputing trends report manually (test included)

Testing instruction

  1. Create checklist that has one or numeric tasks
  2. Create recurrence for created checklist
  3. Call API to get recurrence trends report in CSV format -- Expected behavior: No error returned (500), empty CSV responded
  4. Configure to generate some recurrence runs
  5. Deactivate recurrence and call compare API with a date range -- Expected behavior: List of run responded properly
  6. Navigate to Admin > Workflow > Recurrence trend task reports
  7. Delete all trends report of the recurrence
  8. Run command to trigger creating and computing trends report for recurrence
python manage.py create_and_compute_trends_report --recurrence_id <recurrence_id>
  1. Check Recurrence trend task reports instances in the admin UI again -- Expected behavior: Trends reports of all task definitions are created for the recurrence and data is computed properly

PoW

https://www.loom.com/share/9d5f309f73aa4aea84406c8b0858e86d

Edited by Dat Nguyen

Merge request reports