I have a data model where each user profile belongs to a department. Each job is also available for a specific department. The department names are formatted like this: AAA-BBB-CCC-DDD-EEE, but of variable lenght - e.g. one user may have only 3 levels ('AAA-BBB-CCC', and other user may have 2 levels - 'XYZ-WVM'), with a maximum of 5 levels depth. The other requirement is that when a job is posted for a specific department, it should be visible to all users from that department, from above levels, and lower levels that share the same hierachy. Example:
Job Z is posted for department 'AAA-BBB-CCC-DDD'. This means it should be available to all users from that same department, but also to users whose department is just 'AAA-BBB-CCC' or 'AAA-BBB' or 'AAA'. Not for users whose department is 'AAA-XXX' though. The job should also be available to users from 'AAA-BBB-CCC-DDD-EEE', 'AAA-BBB-CCC-DDD-XXX'.
Another requirement is that new departments should be easy to add.
What's a good design for this job? I'm using a relational database (SQLite for the moment).
Aucun commentaire:
Enregistrer un commentaire