Skip to content

Instantly share code, notes, and snippets.

@lambda2
Created October 12, 2015 11:24
Show Gist options
  • Select an option

  • Save lambda2/996428e53440af8d2f5e to your computer and use it in GitHub Desktop.

Select an option

Save lambda2/996428e53440af8d2f5e to your computer and use it in GitHub Desktop.

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_at field 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_at and final_mark fields 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_at field 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment