public function buildRoutes(EntityReflectionInterface $entity)
    {
        $collection = $this->entityActionCollectionBuilder->build($entity);

        $routes = [];

        /** @var EntityActionInterface $action */
        foreach ($collection as $action) {
            $pattern = '/'.$entity->getSlug().'/'.$action->getSlug();
            $defaults = [
                '_controller'   => $this->queryController,
                'orchestra_type' => $this::ROUTE_TYPE,
                'entity_method' => $action->getMethod(),
                'method_slug'   => $action->getSlug(),
                'entity_slug'   => $entity->getSlug()
            ];
            $requirements = [
                '_method'       => $this->methodRequirement
            ];

            if (true === $action->isCommand()) {
                $defaults['_controller'] = $this->commandController;

                // We add a "command"
                $defaults['command_class'] = $action->getCommandClass();

                $requirements['_method'] = 'GET|POST';
            }

            if (true === $action->emitEvent()) {
                $defaults['_controller'] = $this->eventController;
            }

            $route = new Route($pattern, $defaults, $requirements);
            $routeName = $action->getRouteName();

            $routes[$routeName] = $route;
        }

        return $routes;
    }