I have created an application in which users and tasks can be entered.
A task should be be assigned to one or more users. If more users can do a task, the task should be assigned in such a way that it can be done by person A OR person B, or that person A AND person B have to do the task together.
In addition, more complex combinations are also conceivable: A task could be carried out by (person A AND person B together) OR (person C AND person D together).
My thought on in which format could best save the assignment of people to tasks in a database: I should create a relationship table, which basically shows which people are related to which tasks (m: n). This means that a database query can be used to select which tasks are assigned to a person (together with other people). In addition, I have to save a string with the task that specifies which combination of people are permitted - e.g. (A AND B) OR (C AND D).
In which format or which notation should I save this string in the database, so that also complex relationships can be processed (saved, read) easily, eg. ?
- Reverse Polish notation / Postfix notation
- Infix notation
- Polish notation / Prefix notation
- By using database relations instead? If so, how?
(I'm currently even not sure how I should present this to the user so that it can be understood easily, but that's not the focus of the question here.)
Thank you very much for every hint/thought in advance!