Hello guys,
I have been thinking about the best way to do this and would like to brainstorm with you.
I am developing this simple SaaS project where there will be 3 different user roles, one that can add products, one that can view and comment on products and one that can interact between the seller and buyer (for example).
The only thing that is the same in all roles is email and password. Initially, I setup 3 tables, one for each user role. But this would add extra complexity to the code with JWT-Auth, for example.
What do you suggest doing?
Setup one user table with just the credential stuff and a role column.
Then 3 columns, seller, buyer, intermediator, assigning a user_id on each of them to get the auth info.
If I chose this way, how do you proceed with user registration? Upon registering the user, write the information on the two tables that the role is assigned to?
Is there any common sense/knowledge/documentation about this?
Thank you very much :)