API Documentation
  • 🦸User
    • 🐔requestDeveloperVerification
    • ☑️Accept Developer verification
    • 🚫Reject developer verification
    • 🆕NEW Authentication Trigger
  • 📧Send emails
  • 📂Projects
    • 📩Invite a new Team member
  • 📔Tasks
    • 💣Cancel Task
    • 🔎Submit task
    • 👨‍💻Assign Task
  • Step 1 taskflow
    • ✅Accept task
    • ❌Reject task
    • ⏳Deadline reached
  • Step 2 taskflow
    • ✅Accept developer (creator)
    • ❌Reject developer (creator)
  • Step 3 taskflow
    • 🚦Submit for review
    • ⏳Review Deadline reached
    • ✅Accept work result
    • ❌Reject work result
  • Step 4 Taskflow
    • 💸Generate Invoice
    • 💸Mark invoice as paid
Powered by GitBook
On this page
  • Input parameters
  • How to call from app
  • Logic
  1. Tasks

Assign Task

Assigne task documetation

PreviousSubmit taskNextAccept task

Last updated 2 years ago

Input parameters

  • TaskID

  • Email-Adress of Assigned member

How to call from app

import { httpsCallable } from 'firebase/functions';

await httpsCallable(functions, 'assignTask')({ taskId, email })

Logic

Miro:

As a user, i want to assign tasks directly to an email address.

How to check if user exists? Checkout:

TO BE CONTINUED!!!

If the user with email address exists: {

  1. get uid of user by Email adress

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

    1. add the ProjectId to the thirdPartyProjects array

    2. Then add the taskId to the assignedTasks array

}

  1. Changes in the Project (/projects/projectId)

    • Change the databaseStatus of the task in the project document to "assigned".

    • Add the email address of the assigned person to members array

    • add a field to the tasks array element that has the TaskId "assignedTo" add the uid as value

2. Add user email to "projects/{projectId}/members" array

3. Move the Tasks from its previous position to here: (/tasks/assigned/all/taskId) and delete the copy in the old database position.

3. Add user (developer) email to "tasks/{taskId}.assignToEmail"

If the user with email address exists: {

4. Send First Email:

  • to_email_adress = email_of_assigned_person

  • template_name = "tasks-assigned->developer"

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

}

If the user with email address does NOT exists: {

Send Emial:

  • to_email_adress = email_of_assigned_person

  • template_name = "tasks-assigned->new-user"

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

}

5. Send Second Email:

  • to_email_adress = email_of_task_creator

  • template_name = "tasks-assigned->creator"

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

📔
👨‍💻
https://miro.com/app/board/uXjVPbexhys=/?share_link_id=959063091369
https://stackoverflow.com/questions/51562995/how-can-i-check-if-user-exists-in-firebase
Bildschirmfoto 2022-11-08 um 11 24 03