A
A
Anton Ivanov2021-08-11 06:03:34
Software design
Anton Ivanov, 2021-08-11 06:03:34

What architecture to use for a user profile that cannot be changed without moderation?

The user has a profile. Phone/email/address, yes, it doesn't matter what is
needed to prevent the user from changing their profile without pre-moderation. That is, if the user registers
new data, then they go to the admins for verification, and the previously approved data remains active. If the admins reject the changes, then the data that was previously approved remains in the profile.

I see several options for implementing "temporary" and "approved" profiles

1. Completely separate models, like Profile and PendingProfile. Of the minuses - you need to monitor the consistency of the fields and add / delete fields in two tables / models at the same time.

2. One model with a feature, it is a profile approved, or temporary.

3. Profile model with JSON temporary data field. IMHO, collective farm

4. Profile model with "parent profile" field. If there is a parent, then this is a temporary profile. This is a special case of the second option. As a plus, you can fill in the temporary profile only those fields that the user wants to change, and pull the unchanged ones from the approved profile.

What approach is usually used to implement this logic?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question