# Accept work result

### Input parameters

* TaskID

### How to call from app

HTTP request to: /accept-work-result/TASKID

### Logic

1. The frontend (app.tasksource.io) calls the API (api.tasksource.io/accept-work-result/TASK-ID)

2. the backend should now set a field in the task document (workResultIsAccepted = true)

3. change task document databaseStatus into "closed".&#x20;

4. call the gernreate invoiced API (<https://desent-solutions-gmbh.gitbook.io/api-documentation/step-4-taskflow/generate-invoice>)

5. Send First Email:

   * to\_email\_adress = email\_of\_assigned\_person
   * template\_name = "work-result-accepted->developer"
   * data = {taskData: taskData, taskId: taskId}

6. ~~Send Second Email:~~
   * ~~to\_email\_adress = email\_of\_task\_creator~~
   * ~~template\_name = "work-result-accepted->creator"~~
   * ~~data = {taskData: taskData, taskId: taskId}~~
