Restore the original report_type-driven endpoint (users/tickets picked
individually via serializer + orchestrator) that was replaced by the
bundled zip export in b293509, on top of current master.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
11 lines
371 B
Python
11 lines
371 B
Python
from apps.reports.services.report_types import REPORT_TYPES
|
|
|
|
|
|
class ReportOrchestrator:
|
|
@classmethod
|
|
def available_reports(cls):
|
|
return [(report_type, report_type) for report_type in REPORT_TYPES.keys()]
|
|
|
|
def generate(self, payload):
|
|
report = REPORT_TYPES[payload["report_type"]]()
|
|
return report.generate(payload.get("filters") or {})
|