automationStorage = $automationStorage; $this->overviewStatisticsController = $overviewStatisticsController; } public function handle(Request $request): Response { $id = absint(is_numeric($request->getParam('id')) ? $request->getParam('id') : 0); $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(), ]; } }