class AssessmentSummaryController {

    @PostMapping("/{assessmentId}/summary")
    public String save(Model model,
                       @Valid @ModelAttribute(FORM_ATTR_NAME) AssessmentSummaryForm form,
                       BindingResult bindingResult,
                       ValidationHandler validationHandler,
                       @PathVariable("assessmentId") Long assessmentId) {

        Supplier<String> failureView = () -> getSummary(model, form, bindingResult, assessmentId);

        return validationHandler.failNowOrSucceedWith(failureView, () -> {
            ServiceResult<Void> updateResult = assessmentService.recommend(assessmentId, form.getFundingConfirmation(), form.getFeedback(), form.getComment());
            return validationHandler.addAnyErrors(updateResult, fieldErrorsToFieldErrors(), asGlobalErrors())
                    .failNowOrSucceedWith(failureView, () -> redirectToCompetitionOfAssessment(assessmentId));
        });
    }

}