Structuring a user types in scrapi

In this case I would recommend 3 new models:

  • Companies
  • Customers
  • Employees

Each of these would have a relation to the users model from the users-permissions, this would allow for different fields for each but still maintaining a single users model. Management of the relations could be done via the model lifecycles or some custom logic. (you will probably need to have some policies as well for security)

Beyond that we don’t have any sample code for this use case.

1 Like