From that StackOverflow's question:
- My CRUDs are: customers, employees and branches.
Employees are associated with one
Individual(fields related to the person itself) and one
User(for login purposes). So
Users are always related to one
Branches are associated with one
Company(fields related to the corporate person). So
Companys are always related to one
Branchperson. They didn't have an user because they're affiliated to the company that this database stands for - it's their employees who can authenticate into the app.
Employeebelongs to one
Branchhas zero or many
Employees. (yeah, diagram is incorrect, sorry!)
- Currently I'm using a single bit to diff
Employeerole - I've employees with operational and administrative rights. Roles permissions goes in the code itself, and here you can realize that customers also have their own role... Any suggestions to implement a better (and simple) way to manage that roles for both customers and employees?
How should I change that wrong 3NF structure to achieve a well designed single table inheritance for a better use of MVC pattern?
Ok, I tried to simplify it a bit, and now I accomplished this new structure:
Can I still improve it? How?