Add user account deletion handling and event publishing for cleanup #176
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature for handling user account deletion and profile cleanup, along with some refactoring and improvements in the codebase. The most important changes include the addition of a new event for pre-deletion operations, updates to the user service to handle account deletion or disabling, and documentation updates to reflect these changes.
New feature for user account deletion and profile cleanup:
README.md: Added a new section on handling user account deletion and profile cleanup, including enabling actual deletion and cleaning up related data. [1] [2]Code refactoring and improvements:
src/main/java/com/digitalsanctuary/spring/user/api/UserAPI.java: Refactored thedeleteAccountmethod to use the newdeleteOrDisableUsermethod from the user service. [1] [2]src/main/java/com/digitalsanctuary/spring/user/event/UserPreDeleteEvent.java: Added a new event classUserPreDeleteEventto handle pre-deletion logic.src/main/java/com/digitalsanctuary/spring/user/service/UserService.java: Updated the user service to include thedeleteOrDisableUsermethod, which handles both deletion and disabling of user accounts, and publishes theUserPreDeleteEvent. [1] [2] [3] [4] [5] [6] [7]Minor updates:
src/main/java/com/digitalsanctuary/spring/user/profile/BaseUserProfile.java: Added a foreign key constraint to theuser_idcolumn inBaseUserProfile. [1] [2] [3]