"""Command handlers for Phase 11.10 analytics."""
from app.services.analytics import ExperienceAnalyticsService


class AnalyticsCommands:
    def __init__(self, session):
        self.service = ExperienceAnalyticsService(session)

    async def create_report_definition(self, tenant_id, body, *, actor=None):
        return await self.service.create_report_definition(tenant_id, body, actor=actor)

    async def update_report_definition(self, tenant_id, entity_id, body, *, actor=None):
        return await self.service.update_report_definition(
            tenant_id, entity_id, body, actor=actor
        )

    async def delete_report_definition(self, tenant_id, entity_id, *, actor=None):
        return await self.service.delete_report_definition(tenant_id, entity_id, actor=actor)

    async def refresh_snapshot(self, tenant_id, body, *, actor=None):
        return await self.service.refresh_snapshot(tenant_id, body, actor=actor)

    async def update_snapshot(self, tenant_id, entity_id, body, *, actor=None):
        return await self.service.update_snapshot(tenant_id, entity_id, body, actor=actor)

    async def delete_snapshot(self, tenant_id, entity_id, *, actor=None):
        return await self.service.delete_snapshot(tenant_id, entity_id, actor=actor)
