automationStorage = $automationStorage; $this->overviewStatisticsController = $overviewStatisticsController; } public function handle(Request $request): Response { $id = absint($request->getParam('id')); $automation = $this->automationStorage->getAutomation($id); if (!$automation) { throw Exceptions::automationNotFound($id); } $query = QueryWithCompare::fromRequest($request); $result = $this->overviewStatisticsController->getStatisticsForAutomation($automation, $query); return new Response($result); } public static function getRequestSchema(): array { return [ 'id' => Builder::integer()->required(), 'query' => QueryWithCompare::getRequestSchema(), ]; } }