class ApplicationSectionController {

    @SecuredBySpring(value = "TODO", description = "TODO")
    @PreAuthorize("hasAuthority('applicant')")
    @GetMapping("/{sectionType}")
    public String redirectToSection(@PathVariable SectionType sectionType,
                                    @PathVariable long applicationId,
                                    UserResource user) {
        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), user);
        }
        return "redirect:/application/" + applicationId;
    }

}