class FinanceContactController {

    @PreAuthorize("hasPermission(#projectId, 'org.innovateuk.ifs.project.resource.ProjectCompositeId', 'ACCESS_FINANCE_CONTACT_PAGE')")
    @PostMapping(value = "/{projectId}/team/finance-contact/organisation/{organisationId}")
    public String updateFinanceContact(@PathVariable("projectId") final long projectId,
                                       @PathVariable("organisationId") final long organisationId,
                                       Model model,
                                       @Valid @ModelAttribute("form") FinanceContactForm financeContactForm,
                                       @SuppressWarnings("unused") BindingResult bindingResult, ValidationHandler validationHandler,
                                       UserResource loggedInUser) {

        Supplier<String> failureView = () -> doViewFinanceContact(model, projectId, organisationId, loggedInUser, financeContactForm);

        return validationHandler.failNowOrSucceedWith(failureView, () -> {
            ServiceResult<Void> updateResult = projectDetailsService.updateFinanceContact(new ProjectOrganisationCompositeId(projectId, organisationId), financeContactForm.getFinanceContact());

            return validationHandler.addAnyErrors(updateResult, toField("financeContact")).
                    failNowOrSucceedWith(failureView, () -> redirectToProjectTeamPage(projectId));
        });
    }

    public  FinanceContactController(
            ProjectService projectService,
            ProjectDetailsService projectDetailsService
    );

}