class ApplicationCreationAuthenticatedController {

    @PostMapping("/{competitionId}")
    public String post(@PathVariable(COMPETITION_ID) long competitionId,
                       @Valid @ModelAttribute(FORM_NAME) ApplicationCreationAuthenticatedForm form,
                       BindingResult bindingResult,
                       ValidationHandler validationHandler,
                       HttpServletResponse response) {
        Supplier<String> failureView = () -> "create-application/confirm-new-application";
        Supplier<String> successView = () -> {
            if (form.getCreateNewApplication()) {
                return redirectToOrganisationCreation(competitionId, response);
            }
            // redirect to dashboard
            return "redirect:/";
        };

        return validationHandler.failNowOrSucceedWith(failureView, successView);
    }

}