Hello to everyone
I am writing to you because I am facing a problem that I have not been able to solve for almost a day.
I am currently working on a simple project management application, where users can create “projects” and assign “users” to them. In these projects users can create “tasks” and assign other users to them.
For information I have taken Gregory John’s Udemy course “The bubble beginners bootcamp”.
What I would like to add is the possibility for each user assigned to a task to fill in the number of hours spent on it. This would allow to display the total number of hours spent by the team on a “project dashboard”.
The problem is that I can’t figure out the best way to do this.
So far I’ve thought of:
- Adding an “Hours” field (which is a list of numbers) to the “Task” data type. With the :sum function this allows to calculate the total time spent on the task (and by extension on the project). The disadvantage is that it is not possible with this method to filter which user enters which number of hours for the task. Moreover, there is nothing to prevent the same user to enter several number of hours in the list.
- Create a timesheet for each user and each task. Concretely: create a data type “Timesheet” with the following fields: task, assignee (which contain a unique user assigned to the task → “current user”), hours. This method allows to know exactly which user has spent how many hours on each task. However, this complicates the process enormously because there should only be one timesheet per user and per task…
I think I’m overcomplicating the problem, but I can’t think of a simpler solution. The main difficulty comes from the fact that several users can be assigned to the same task (the data type “task” contains a field “assignees” corresponding to a “list of users”).
Do you have any ideas or tips on how to do this? It would help me a lot!
Thanks in advance and have a nice day