🔎Submit task
As a user, I want to submit a task to be assigned by the algorithm (Admin app for now)
Input parameters
TaskID
How to call from app
Logic
The frontend (app.tasksource.io) calls the API (api.tasksource.io/submit-task/TASK-ID)
the API should copy the document with the TASK-ID from (tasks/drafts/all/TASK-ID) to (tasks/submitted/all/TASK-ID)
Now it should delete the draft document (tasks/drafts/all/TASK-ID)
Update the project document:
each task has one project. That document can be found under (projects/projectId)
the projectId can be found inside the Task document under "projectId"
Now change the databaseStatus of the task inside the project document.
See the image below. The Status should associate to the name of the db collection where the task currently is. So the new status should be "submitted"
Send email to us:
to_email_adress = "info@tasksource.io"
template_name = "tasks-submitted->us"
data = none
Send email to developers
to_email_adress = [ALL developers with one matching skills for task]
template_name = "tasks-submitted->developer"
data = {taskData: taskData, taskId: taskId} (used in template as: )
Lastly, it needs to send a response to the frontend that everything worked.
Last updated