Create a new project, with a single part and an empty task.
Create a new project, with a single part and an empty task.
New projects will *always* need at least one part and task to be useful, so we will simply the creation process and do it all at once.
The new name to give the project.
The new slug to give the project.
The new description for the project.
the updated project.
Create a new part.
Create a new part.
NB: If the new part's position interferes with the position of an existing part, the part list for the project will be updated to reflect the reordered positions. This will necessarily increment their version numbers. The client should be aware to update its part list after calling create.
the unique ID of the project to attach this part to
the part's name
this part's position in the project. If this position has already been taken, the existing parts will be shifted down.
Create a new task.
Create a new task.
the unique ID of the part this task belongs to
the name of this task
a brief description of this task
the position of this task in the part
optionally make this task dependent on another
the newly created task
Database connection (pool).
Database connection (pool). Services will take connections from this pool when making repository calls.
Delete a project.
Delete a project.
NB: This deletes the entire project! All parts, all tasks, including all responses and scratch pads. Wrapped in a transaction.
the UUID of the project to delete
the version of the project to delete
a boolean indicating success/failure
Delete a part.
Delete a part.
NB: When a part is removed from a project, the project's remaining parts must be re-ordered. This necessarily updates the versions of the updated parts w.r.t. optimistic offline lock.
the unique ID of the part to delete
the current version of the part to delete
a boolean indicator whether the operation was successful
Delete a task.
Delete a task.
NB: When a task is removed from a part, the part's remaining tasks must be re-ordered. This necessarily updates the versions of the updated tasks w.r.t. optimistic offline lock.
the unique ID of the task to delete
the current version of the task to delete
a boolean indicator whether the operation was successful
Find a single project by slug and UserID.
Find a single project by slug and UserID.
an optional project
Find a project *if and only if* a user has access to that project.
Find a project *if and only if* a user has access to that project.
the unique id of the project to find
the unique id of the user to filter by
a future disjunction containing either a project, or a failure
Find a single project by ID.
Find a single project by ID.
an optional project
Find a single project by slug.
Find a single project by slug.
an optional project
Find the "now" task for a student in a project
Find the "now" task for a student in a project
the unique of the id of the student
the unique id of the project
a future disjunction containing either the now task, or a failure
Find a single part.
Find a single part.
the id of the part
a vector of this project's parts
Find a task by its position in a project.
Find a task by its position in a project.
the text slug of the project this task is in
the number (corresponds to 'position' field) of the part that this task is in.
the number (position) of the task inside the part.
an Option[Task] if one was found.
Find a task by its ID.
Find a task by its ID.
Find all projects belonging to a given course
Find all projects belonging to a given course
the unique id of the course to filter by
a future disjunction containing either a vector of projects, or a failure
Lists all projects.
Lists all projects.
a future disjunction containing either a vector of projects, or a failure
List the parts that have a component.
List the parts that have a component.
the UUID of the component to filter by
Find all projects a user has access to.
Find all projects a user has access to.
the unique id of the user to filter by
a future disjunction containing either a vector of projects, or a failure
Find all projects a user has access to.
Find all projects a user has access to.
the unique id of the user to filter by
a future disjunction containing either a vector of projects, or a failure
Moves a task from one part to another.
Moves a task from one part to another.
the new part that this task should belong to
the unique ID of the task to be moved
the new position for this task
Reorder the parts in a project.
Reorder the parts in a project.
the unique id of the project to reorder parts for
the unique ids of the project's current parts, in the new order the parts should have
a future disjunction containing either the updated project, or a failure
Enable a disabled part, and disable an enabled part.
Enable a disabled part, and disable an enabled part.
the unique ID of the part to toggle
the current version of the part to toggle
a future disjunction containing either the toggled part, or a failure
Takes a function that returns a future, and runs it inside a database transaction.
Takes a function that returns a future, and runs it inside a database transaction.
Update an existing project.
Update an existing project.
The unique ID of the project to update.
The current version of the project.
The new name to give the project.
The new description for the project.
the updated project.
Update a LongAnswerTask.
Update a MatchingTask
Update a MatchingTask
Update a MultipleChoiceTask
Update a MultipleChoiceTask
Update an OrderingTask
Update an OrderingTask
Update an existing part.
Update an existing part.
NB: If the part's updated position interferes with the position of another part, the part list for the project will be updated to reflect the reordered positions. This will necessarily increment their version numbers. The client should be aware to update its part list after calling update.
Update a ShortAnswerTask
Update a ShortAnswerTask
Update a project's slug.
Update a project's slug. This is a URL-friendly unique identifier for the project.
Checks if a user has access to a project.
Checks if a user has access to a project.
the UUID of the user to check
the slug of the project to look for
a boolean indicating success or failure