class ApplicationSectionController {

    @SecuredBySpring(value = "TODO", description = "TODO")
    @PreAuthorize("hasAnyAuthority('applicant', 'support', 'innovation_lead', 'ifs_administrator', 'comp_admin', 'project_finance', 'stakeholder', 'external_finance', 'knowledge_transfer_adviser')")
    @GetMapping("/{sectionType}/{organisationId}")
    public String redirectToSectionManagement(@PathVariable SectionType sectionType,
                                              @PathVariable long applicationId,
                                              @PathVariable long organisationId) {
        ApplicationResource application = applicationRestService.getApplicationById(applicationId).getSuccess();
        List<SectionResource> sections = sectionRestService.getSectionsByCompetitionIdAndType(application.getCompetition(), sectionType).getSuccess();
        if (sections.size() == 1) {
            return redirect(applicationId, sections.get(0), organisationId);
        }
        return "redirect:/application/" + applicationId;
    }

}