class AssessmentApplicationProgressController extends CompetitionManagementCookieController<AvailableAssessorForm> {

    @PostMapping
    public String assignAssessor(@PathVariable("competitionId") Long competitionId,
                                 @PathVariable("applicationId") Long applicationId,
                                 @ModelAttribute(SELECTION_FORM) AvailableAssessorForm selectionForm,
                                 HttpServletRequest request) {
        AvailableAssessorForm submittedSelectionForm = getSelectionFormFromCookie(request, competitionId)
                .filter(form -> !form.getSelectedAssessors().isEmpty())
                .orElse(selectionForm);

        List<AssessmentCreateResource> assessments = submittedSelectionForm.getSelectedAssessors().stream()
                .map(assessorId -> new AssessmentCreateResource(applicationId, assessorId))
                .collect(Collectors.toList());
        assessmentRestService.createAssessments(assessments).getSuccess();
        return format("redirect:/assessment/competition/%s/application/%s/assessors", competitionId, applicationId);
    }

}