Class UserDeletionUtil

java.lang.Object
com.example.lottery.util.UserDeletionUtil

public final class UserDeletionUtil extends Object
Utility for cleaning up user-related records before deleting a user document.
  • Method Details

    • cleanUpUserRecords

      public static void cleanUpUserRecords(com.google.firebase.firestore.FirebaseFirestore db, String userId, Runnable onDone)
      Batch-deletes all records for the given user across every event (co-organizers and waitlists), and also clears their local sub-collections (like inbox), then invokes onDone.
      Parameters:
      db - Firestore instance
      userId - the user whose documents should be removed
      onDone - callback invoked after cleanup completes or fails
    • cleanUpCoOrganizerRecords

      public static void cleanUpCoOrganizerRecords(com.google.firebase.firestore.FirebaseFirestore db, String userId, Runnable onDone)
      Batch-deletes only co-organizer records for the given user across every event.