class ProjectFinanceFundingLevelController {

    @GetMapping
    public String viewFundingLevels(@ModelAttribute(name = "form", binding = false) ProjectFinanceFundingLevelForm form,
                                    @PathVariable long projectId,
                                    Model model,
                                    BindingResult bindingResult) {
        List<ProjectFinanceResource> projectFinances = projectFinanceRestService.getProjectFinances(projectId).getSuccess();

        form.setPartners(projectFinances.stream()
                .collect(toMap(ProjectFinanceResource::getOrganisation,
                        pf -> new ProjectFinancePartnerFundingLevelForm(pf.getGrantClaimPercentage()))));
        projectFinanceRestService.hasAnyProjectOrganisationSizeChangedFromApplication(projectId).andOnSuccess(() ->
                validateMaximumFundingLevels(bindingResult, projectFinances, form));
        return viewFunding(projectId, projectFinances, model);
    }

}