I want to develop a multi-vendor e-commerce backend. It has 4 types of users.
If I use a collection model and user_type to handle 4types of users then a staff/vendor will not able to register as a customer. If I use different collection models for different types of users then there will be too many routes. I need to develop login, register, update, getOne, getAll routes for each type of user.
So, which is the best way to design a collection for multi-type users and manage routes in efficient way.
You can manage in same collection like email with user_type, if email already registered as staff or vender(user_type like staff/vendor) restrict user to register as a customer. You can easily manage using email with user_type check.