I have a SaaS project which many companies will use and within the companies there will be employees which will be applied to one of two groups: Supervisor or Non-Supervisor. This will probably look as such:
class EmployeeGroup(Group):
....
Each company will be able to create their own EmployeeType which falls into one of the EmployeeGroups. e.g. an EmployeeType may be Food and Beverage Supervisor which is an EmployeeGroup: Supervisor:
class EmployeeType(models.Model):
....
employee_type = models.CharField(
max_length=32,
default='Server'
)
employee_group = models.ForeignKey(
EmployeeGroup,
null=True
)
company = models.ForeignKey(
Company,
on_delete=models.CASCADE,
null=True
)
And obviously each User will have an EmployeeType:
class User(AbstractUser):
....
employee_type = models.ManyToManyField(
EmployeeType,
null=True,
)
In this situation, can several companies share EmployeeGroups without sharing EmployeeTypes? My concern is that if an EmployeeType: Server is created at Company A then Company B will not be able to create an EmployeeType: Server as well. Or that if they do then information will get crossed. It wuold help to have an understanding of how the database works but I do not. Any links to external resources specific to this situation would be greatly appreciated!