class ProjectUKCorrespondenceAddressController extends AddressLookupBaseController {

    @PreAuthorize("hasPermission(#projectId, 'org.innovateuk.ifs.project.resource.ProjectCompositeId', 'ACCESS_PROJECT_ADDRESS_PAGE')")
    @PostMapping("/{projectId}/details/project-address/UK")
    public String updateAddress(@PathVariable("projectId") final Long projectId,
                                Model model,
                                @Valid @ModelAttribute(FORM_ATTR_NAME) ProjectDetailsAddressForm form,
                                @SuppressWarnings("unused") BindingResult bindingResult,
                                ValidationHandler validationHandler) {
        ProjectResource projectResource = projectService.getById(projectId);

        if (validationHandler.hasErrors()) {
            return viewCurrentAddressForm(model, form, projectResource);
        }
        projectResource.setAddress(form.getAddressForm().getSelectedAddress(this::searchPostcode));
        OrganisationResource leadOrganisation = projectService.getLeadOrganisation(projectResource.getId());
        ServiceResult<Void> updateResult = projectDetailsService.updateAddress(projectId, projectResource.getAddress());
        return updateResult.handleSuccessOrFailure(
                failure -> {
                    validationHandler.addAnyErrors(failure, asGlobalErrors());
                    return viewAddress(projectId, model, form);
                },
                success -> redirectToProjectDetails(projectId));
    }

}