class ProjectDetailsServiceImpl extends AbstractProjectServiceImpl implements ProjectDetailsService {

    @Override
    @Transactional
    public ServiceResult<Void> updateProjectAddress(Long projectId, AddressResource address) {
        return getProject(projectId).
                andOnSuccess(project -> validateGOLGenerated(project, PROJECT_SETUP_PROJECT_ADDRESS_CANNOT_BE_UPDATED_IF_GOL_GENERATED)).
                andOnSuccess(() ->
                        find(getProject(projectId)).
                                andOnSuccess(project -> {
                                    if (project.getAddress() != null) {
                                        project.getAddress().copyFrom(address);
                                    } else {
                                        project.setAddress(addressRepository.save(addressMapper.mapToDomain(address)));
                                    }

                                    return getCurrentlyLoggedInPartner(project).andOnSuccess(user -> {
                                        projectDetailsWorkflowHandler.projectAddressAdded(project, user);
                                        return serviceSuccess();
                                    });
                                })
                );
    }

}