class YourProjectLocationController extends AsyncAdaptor {

    @PostMapping(params = "mark-as-complete")
    @PreAuthorize("hasAuthority('applicant')")
    @SecuredBySpring(value = "MARK_PROJECT_LOCATION_AS_COMPLETE", description = "Applicants can mark their project location as complete")
    public String markAsComplete(
            @PathVariable("applicationId") long applicationId,
            @PathVariable("organisationId") long organisationId,
            @PathVariable("sectionId") long sectionId,
            UserResource loggedInUser,
            @Valid @ModelAttribute("form") YourProjectLocationForm form,
            @SuppressWarnings("unused") BindingResult bindingResult,
            ValidationHandler validationHandler,
            Model model) {

        formatLocationInForm(form);

        Supplier<String> failureHandler = () -> {
            CommonYourProjectFinancesViewModel viewModel = getViewModel(applicationId, sectionId, organisationId, loggedInUser);
            model.addAttribute("model", viewModel);
            model.addAttribute("form", form);
            return VIEW_PAGE;
        };

        Supplier<String> successHandler = () -> {

            updateLocation(applicationId, organisationId, form);

            ProcessRoleResource processRole = userRestService.findProcessRole(loggedInUser.getId(), applicationId).getSuccess();
            ValidationMessages validationMessages = sectionService.markAsComplete(sectionId, applicationId, processRole.getId());
            validationHandler.addAnyErrors(validationMessages);

            return validationHandler.failNowOrSucceedWith(failureHandler, () -> redirectToYourFinances(applicationId));
        };

        return validationHandler.
                addAnyErrors(validateProjectLocation(organisationId, form)).
                failNowOrSucceedWith(failureHandler, successHandler);
    }

    public  YourProjectLocationController();
    @Autowired  YourProjectLocationController(
            CommonYourFinancesViewModelPopulator commonViewModelPopulator,
            YourProjectLocationFormPopulator formPopulator,
            ApplicationFinanceRestService applicationFinanceRestService,
            SectionService sectionService,
            UserRestService userRestService,
            OrganisationRestService organisationRestService);

}