Phase 5 Batch 5 Task 5.18: Report Generator PDF-Support & Druck-Funktionen

- Installed WeasyPrint 69.0 for PDF generation
- Created 5 Jinja2 HTML templates: contact_list, calendar_week, calendar_month, company_list, audit_log
- All templates: A4 landscape, print-optimized CSS (@media print, page margins)
- Extended output_format in schemas.py: added pdf and print
- Created pdf_generator.py: Jinja2 + WeasyPrint pipeline with preset support
- Modified routes.py: PDF/print generation, preset endpoints (/presets, /presets/generate)
- Added RBAC (require_permission) to all report endpoints
- Generate endpoints return StreamingResponse (file download) directly
- 7 backend tests: presets listing, PDF/CSV generation, template CRUD, RBAC
This commit is contained in:
Agent Zero
2026-07-23 23:22:33 +02:00
parent 3c8e41b3f8
commit 15f1a57c0f
11 changed files with 1248 additions and 43 deletions
@@ -25,7 +25,7 @@ class ReportGeneratorPlugin(BasePlugin):
],
events=["report.requested", "report.generated"],
migrations=["0001_initial.sql"],
permissions=["reports.read", "reports.generate", "reports.manage_templates"],
permissions=["reports:read", "reports:generate", "reports:manage_templates"],
menu_items=[
FrontendMenuItem(label_key='nav.reports', label='Reports', path='/reports', icon='BarChart3', order=70),
],