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

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:

  • template_name = "tasks-submitted->us"

  • data = none

  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.

PreviousCancel TaskNextAssign Task

Last updated 1 year ago

to_email_adress = ""

📔
🔎
info@tasksource.io
Bildschirmfoto 2022-11-08 um 09 39 51