The ProjectsUser represents the subscription of an user on a project. A subscribed user can have one or more teams based on his number of attempts to this project. Be careful to always select the active team (the last team).
Here is basically the different states a user can have on a project:
- He (the user) has't any projects_user, he is not registered on the project.
- He has no team, he is actually searching a group, in order to make one.
- He has a team, wich is not locked (the
locked_atfield is not null), he is creating a group.
If the user have a locked team, he did, or he is doing the project. At this point, the available states are:
- His team is closed and has a final_mark (the
locked_at,closed_atandfinal_markfields aren't null), he has finished his project. If he don't have a final_mark yet, he his waiting for correction. - His team is not closed yet (and obviously don't have a final mark), he is in progress.
Some exceptional cases heppens when a project has children (like piscines), or begins in a specific time (like rushes).
- The team is locked, but the project have a
begin_atfield wich is in the future, so he his waiting to start. - The team is locked, but the project has children. In this case, look at the teams on the child projects, and consider this one in progress.