class QuestionPriorityOrderService {

    @Transactional
    @NotSecured("Must be secured by other services.")
    public Question prioritiseResearchCategoryQuestionAfterCreation(Question createdQuestion) {
        // The Research Category question should be prioritised after the Application Details question

        Question applicationDetailsQuestion = questionRepository.findFirstByCompetitionIdAndQuestionSetupType
                (createdQuestion.getCompetition().getId(), QuestionSetupType.APPLICATION_DETAILS);

        QuestionSection questionSection = QuestionSection.findByName(createdQuestion.getSection().getName());
        updateFollowingQuestionsPrioritiesByDelta(1, applicationDetailsQuestion.getPriority(), createdQuestion.getCompetition()
                .getId(), questionSection);

        createdQuestion.setPriority(applicationDetailsQuestion.getPriority() + 1);
        return questionRepository.save(createdQuestion);

    }

}