Reject task

As a developer i want to be able to reject a task.

Input parameters

  • taskId
  • rejectionReason

How to call from app

HTTP request to: /reject-task/TASKID

import { httpsCallable } from 'firebase/functions';

await httpsCallable(functions, 'rejectTask')({ 
    taskId: task.id,
    rejectionReason: currentTask.rejectionReason,
})

Logic

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

  2. get developer document in DB (users/uid)

    1. remove the ProjectId to the thirdPartyProjects array

    2. Then remove the taskId to the assignedTasks array

  3. Remove developer from project members (projects/{projectId}/members) array if no other task with same projectId found

  4. the backend should now set a field in the task document (acceptedByDeveloper = false) as well as , rejectionReason: rejectionReason

  5. Send First Email:

    • to_email_adress = email_of_assigned_person

    • template_name = "tasks-rejected-by-developer->developer"

    • data = {taskData: taskData, taskId: taskId, rejectionReason: rejectionReason}

  6. Send Second Email:

    • to_email_adress = email_of_task_creator

    • template_name = "tasks-rejected-by-developer->creator"

    • data = {taskData: taskData, taskId: taskId, rejectionReason: rejectionReason}

5. If task was assogned to pool (assignToPool = true) call api endpoint submit task

6. if assignToPool = false set task to draft status again.

Last updated