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.external.models;
  
  import com.fasterxml.jackson.annotation.JsonIgnore;
  import lombok.Getter;
  import lombok.Setter;
  import lombok.ToString;
  import org.springframework.data.annotation.CreatedBy;
  import org.springframework.data.annotation.CreatedDate;
  import org.springframework.data.annotation.Id;
  import org.springframework.data.annotation.LastModifiedBy;
  import org.springframework.data.annotation.LastModifiedDate;
  import org.springframework.data.annotation.Version;
  import org.springframework.data.domain.Persistable;
  import org.springframework.data.mongodb.core.index.Indexed;
  
  import java.time.Instant;
  
  
  /**
   * TODO :
   * Move BaseDomain back to appsmith-server.domain. This is done temporarily to create templates and providers in the same database as the server
   */
  @Getter 
  @Setter
  @ToString
  public abstract class BaseDomain implements Persistable<String> {
  
      private static final long serialVersionUID = 7459916000501322517L;
  
      @Id
      private String id;
  
      @JsonIgnore
      @Indexed
      @CreatedDate
      protected Instant createdAt;
  
      @JsonIgnore
      @LastModifiedDate
      protected Instant updatedAt;
  
      @CreatedBy
      protected String createdBy;
  
      @LastModifiedBy
      protected String modifiedBy;
  
      protected Boolean deleted = false;
  
      @JsonIgnore
      @Version
      protected Long documentVersion;
  
      @JsonIgnore
      @Override
      public boolean isNew() {
          return this.getId() == null;
      }
  
  }
  