class ApplicationOverviewController {

    @GetMapping("/{applicationId}")
    @AsyncMethod
    public String applicationOverview(Model model,
                                     @PathVariable("applicationId") long applicationId,
                                     UserResource user) {
        ApplicationResource application = applicationRestService.getApplicationById(applicationId)
                .getSuccess();

        if (application.getCompetitionStatus() != CompetitionStatus.OPEN
                || userIsKta(user.getId(), application.getId())) {
            return format("redirect:/application/%s/summary", application.getId());
        }

        if (application.isSubmitted()) {
            return format("redirect:/application/%s/track", application.getId());
        }

        changeApplicationStatusToOpen(application, user);

        model.addAttribute("model", applicationOverviewModelPopulator.populateModel(application, user));
        return "application-overview";
    }

    public  ApplicationOverviewController();
    @Autowired public  ApplicationOverviewController(ApplicationOverviewModelPopulator applicationOverviewModelPopulator,
                                 UserRestService userRestService,
                                 ApplicationRestService applicationRestService);

}