Reject developer (creator)

As a creator of a task, I want to reject an assigned developer.

Input parameters

  • taskId
  • rejectionReason

How to call from app

HTTP request to: /reject-task/TASKID

import { httpsCallable } from 'firebase/functions';

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

Logic

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

  2. the backend should now set a field in the task document (acceptedByCreator = false) as well as the rejectionReason field

  3. Send First Email:

    • to_email_adress = email_of_assigned_person

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

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

  4. Send Second Email:

    • to_email_adress = email_of_task_creator

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

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

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

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

Last updated