hunk.code_window:                         .thenReturn(true);
               }
               log.debug("The invited user {} doesn't exist in the system. Creating a new record", inviteUser.getEmail());
               // The user doesn't exist in the system. Create a new user object
               newUser.setPassword(inviteUser.getPassword());
               return this.create(newUser)
                       .flatMap(createdUser -> userOrganizationService.addUserToOrganization(newUser.getCurrentOrganizationId(), createdUser))
                       .thenReturn(newUser)
                       .flatMap(userToDelete -> inviteUserRepository.delete(userToDelete))
  
hunk.labels: keep keep keep keep keep replace keep keep keep
hunk.after_edit:             return this.createUser(newUser, originHeader)
  
hunk.file_path: app/server/appsmith-server/src/main/java/com/appsmith/server/services/UserServiceImpl.java
hunk.type: replace
file: package com.appsmith.server.configurations.mongo;
  
  import org.springframework.data.mongodb.core.ReactiveMongoOperations;
  import org.springframework.data.mongodb.repository.support.ReactiveMongoRepositoryFactoryBean;
  import org.springframework.data.repository.Repository;
  import org.springframework.data.repository.core.support.RepositoryFactorySupport;
  
  import java.io.Serializable;
  
  /**
   * This factory bean class is set in the annotation @EnableReactiveMongoRepositories in {@link com.appsmith.server.configurations.CommonConfig}
   * which overrides the default factory bean {@link ReactiveMongoRepositoryFactoryBean}
   *
   * @param <T>
   * @param <S>
   * @param <ID>
   */
  public class SoftDeleteMongoRepositoryFactoryBean<T extends Repository<S, ID>, S, ID extends Serializable>
          extends ReactiveMongoRepositoryFactoryBean<T, S, ID> {
  
      public SoftDeleteMongoRepositoryFactoryBean(Class<? extends T> repositoryInterface) {
          super(repositoryInterface);
      }
  
      @Override
      protected RepositoryFactorySupport getFactoryInstance(ReactiveMongoOperations operations) {
          return new SoftDeleteMongoRepositoryFactory(operations);
      }
  }
  