🔎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

import { httpsCallable } from 'firebase/functions';

await httpsCallable(functions, 'submitTask')({ taskId })

Logic

  1. The frontend (app.tasksource.io) calls the API (api.tasksource.io/submit-task/TASK-ID)

  2. the API should copy the document with the TASK-ID from (tasks/drafts/all/TASK-ID) to (tasks/submitted/all/TASK-ID)

  3. Now it should delete the draft document (tasks/drafts/all/TASK-ID)

  4. 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"

  1. Send email to us:

  1. 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: )

      {{taskData.taskName}}
  2. Lastly, it needs to send a response to the frontend that everything worked.

Last updated