Add ability to delete Maybe account #698

Merged
JoshAntBrown merged 4 commits from feature/user-deletion into main 2024-04-30 23:40:32 +08:00
JoshAntBrown commented 2024-04-30 20:46:58 +08:00 (Migrated from github.com)

/claim #675
Resolves #675

/split @jemiluv8

This PR adds the ability to delete an account.

This approach keeps most of the logic centred around account deactivation, contained within the User model itself.

It uses a validation method to ensure admins aren't able to deactivate their user unless they are the last remaining user in the family. Should validation pass and the account is deactivated then it automatically schedules a UserPurgeJob to call the purge method. If there's only one user in the family then purge will destroy the family, otherwise it will just destroy the user. The associated data to the User or Family is currently taken care of by the dependant destroy actions on the relations in each of the models, if needed though the purge function could be expanded to handle those.

To prevent the user from logging in again after deactivating their account before the user or family is purged we modify their email address.

https://github.com/maybe-finance/maybe/assets/1793797/922b0f02-4e15-4c4a-86dd-ed77d055d47d

/claim #675 Resolves #675 /split @jemiluv8 This PR adds the ability to delete an account. This approach keeps most of the logic centred around account deactivation, contained within the User model itself. It uses a validation method to ensure admins aren't able to deactivate their user unless they are the last remaining user in the family. Should validation pass and the account is deactivated then it automatically schedules a UserPurgeJob to call the purge method. If there's only one user in the family then purge will destroy the family, otherwise it will just destroy the user. The associated data to the User or Family is currently taken care of by the dependant destroy actions on the relations in each of the models, if needed though the purge function could be expanded to handle those. To prevent the user from logging in again after deactivating their account before the user or family is purged we modify their email address. https://github.com/maybe-finance/maybe/assets/1793797/922b0f02-4e15-4c4a-86dd-ed77d055d47d
zachgoll (Migrated from github.com) reviewed 2024-04-30 23:32:02 +08:00
zachgoll (Migrated from github.com) left a comment

Everything here looks good and I like the "deactivate" mental model a lot.

Ultimately, I think this is the best solution so we'll get it merged, but given #683 has been open for several days with lots of iterations and collaborations, we'll throw a split on the bounty to embrace the collaborative nature of OSS.

Everything here looks good and I like the "deactivate" mental model a lot. Ultimately, I think this is the best solution so we'll get it merged, but given #683 has been open for several days with lots of iterations and collaborations, we'll throw a split on the bounty to embrace the collaborative nature of OSS.
JoshAntBrown commented 2024-05-01 00:49:53 +08:00 (Migrated from github.com)

Thanks, and yeah that sounds good re: the split, I actually feel a lot better about that approach. I was a bit cautious about making the PR given the outstanding one, but I had a few ideas I wanted to try out and explore so decided to go ahead anyway.

I wasn't aware that splitting was a thing as part of Algora, very cool!

Thanks, and yeah that sounds good re: the split, I actually feel a lot better about that approach. I was a bit cautious about making the PR given the outstanding one, but I had a few ideas I wanted to try out and explore so decided to go ahead anyway. I wasn't aware that splitting was a thing as part of Algora, very cool!
Sign in to join this conversation.