"""Report Generator plugin — PDF/Excel/CSV reports from Jinja2 templates."""

from __future__ import annotations

from app.plugins.base import BasePlugin
from app.plugins.manifest import PluginManifest, PluginRouteDef, FrontendMenuItem, FrontendPageRoute


class ReportGeneratorPlugin(BasePlugin):
    """Report Generator plugin for generating reports from Jinja2 templates."""

    manifest = PluginManifest(
        name="report_generator",
        version="1.0.0",
        display_name="Report Generator",
        description="Generates PDF/Excel/CSV reports from Jinja2 templates and data sources",
        is_core=True,
        dependencies=["permissions"],
        routes=[
            PluginRouteDef(
                path="/api/v1/reports",
                module="app.plugins.builtins.report_generator.routes",
                router_attr="router",
            ),
        ],
        events=["report.requested", "report.generated"],
        migrations=["0001_initial.sql"],
        permissions=["reports:read", "reports:generate", "reports:manage_templates"],
        menu_items=[
            FrontendMenuItem(label_key='nav.reports', label='Reports', path='/reports', icon='BarChart3', order=70),
        ],
        page_routes=[
            FrontendPageRoute(path='/reports', component='@/pages/Reports', protected=True),
        ],
    )
