private function getRulePriority(RuleCreateStruct $ruleCreateStruct): int
    {
        if (is_int($ruleCreateStruct->priority)) {
            return $ruleCreateStruct->priority;
        }

        $lowestRulePriority = $this->queryHandler->getLowestRulePriority();
        if ($lowestRulePriority !== null) {
            return $lowestRulePriority - 10;
        }

        return 0;
    }