1
0

Task Relations (#103)

This commit is contained in:
konrad
2019-09-25 18:44:41 +00:00
committed by Gitea
parent 1272255975
commit 8fe33fd616
20 changed files with 1751 additions and 333 deletions

View File

@ -1,6 +1,6 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2019-09-20 19:04:01.162535903 +0200 CEST m=+0.097033344
// 2019-09-25 20:06:34.002904022 +0200 CEST m=+0.196783505
package swagger
@ -412,7 +412,7 @@ var doc = `{
"JWTKeyAuth": []
}
],
"description": "Returns a team by its ID.",
"description": "Returns a list by its ID.",
"consumes": [
"application/json"
],
@ -420,13 +420,13 @@ var doc = `{
"application/json"
],
"tags": [
"team"
"list"
],
"summary": "Gets one team",
"summary": "Gets one list",
"parameters": [
{
"type": "integer",
"description": "Team ID",
"description": "List ID",
"name": "id",
"in": "path",
"required": true
@ -434,14 +434,14 @@ var doc = `{
],
"responses": {
"200": {
"description": "The team",
"description": "The list",
"schema": {
"type": "object",
"$ref": "#/definitions/models.Team"
"$ref": "#/definitions/models.List"
}
},
"403": {
"description": "The user does not have access to the team",
"description": "The user does not have access to the list",
"schema": {
"type": "object",
"$ref": "#/definitions/code.vikunja.io.web.HTTPError"
@ -3204,6 +3204,134 @@ var doc = `{
}
}
},
"/tasks/{taskID}/relations": {
"put": {
"security": [
{
"JWTKeyAuth": []
}
],
"description": "Creates a new relation between two tasks. The user needs to have update rights on the base task and at least read rights on the other task. Both tasks do not need to be on the same list.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"task"
],
"summary": "Create a new relation between two tasks",
"parameters": [
{
"description": "The relation object",
"name": "relation",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/models.TaskRelation"
}
},
{
"type": "integer",
"description": "Task ID",
"name": "taskID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "The created task relation object.",
"schema": {
"type": "object",
"$ref": "#/definitions/models.TaskRelation"
}
},
"400": {
"description": "Invalid task relation object provided.",
"schema": {
"type": "object",
"$ref": "#/definitions/code.vikunja.io.web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"type": "object",
"$ref": "#/definitions/models.Message"
}
}
}
},
"delete": {
"security": [
{
"JWTKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"task"
],
"summary": "Remove a task relation",
"parameters": [
{
"description": "The relation object",
"name": "relation",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/models.TaskRelation"
}
},
{
"type": "integer",
"description": "Task ID",
"name": "taskID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "The task relation was successfully deleted.",
"schema": {
"type": "object",
"$ref": "#/definitions/models.Message"
}
},
"400": {
"description": "Invalid task relation object provided.",
"schema": {
"type": "object",
"$ref": "#/definitions/code.vikunja.io.web.HTTPError"
}
},
"404": {
"description": "The task relation was not found.",
"schema": {
"type": "object",
"$ref": "#/definitions/code.vikunja.io.web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"type": "object",
"$ref": "#/definitions/models.Message"
}
}
}
}
},
"/tasks/{task}/labels": {
"get": {
"security": [
@ -4143,10 +4271,6 @@ var doc = `{
"description": "The list this task belongs to.",
"type": "integer"
},
"parentTaskID": {
"description": "If the task is a subtask, this is the id of its parent.",
"type": "integer"
},
"percentDone": {
"description": "Determines how far a task is left from being done",
"type": "number"
@ -4155,6 +4279,11 @@ var doc = `{
"description": "The task priority. Can be anything you want, it is possible to sort by this later.",
"type": "integer"
},
"related_tasks": {
"description": "All related tasks, grouped by their relation kind",
"type": "object",
"$ref": "#/definitions/models.RelatedTaskMap"
},
"reminderDates": {
"description": "An array of unix timestamps when the user wants to be reminded of the task.",
"type": "array",
@ -4170,13 +4299,6 @@ var doc = `{
"description": "When this task starts.",
"type": "integer"
},
"subtasks": {
"description": "An array of subtasks.",
"type": "array",
"items": {
"$ref": "#/definitions/models.Task"
}
},
"task_ids": {
"description": "A list of task ids to update",
"type": "array",
@ -4499,6 +4621,111 @@ var doc = `{
}
}
},
"models.RelatedTaskMap": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "object",
"properties": {
"assignees": {
"description": "An array of users who are assigned to this task",
"type": "array",
"items": {
"$ref": "#/definitions/models.User"
}
},
"created": {
"description": "A unix timestamp when this task was created. You cannot change this value.",
"type": "integer"
},
"createdBy": {
"description": "The user who initially created the task.",
"type": "object",
"$ref": "#/definitions/models.User"
},
"description": {
"description": "The task description.",
"type": "string"
},
"done": {
"description": "Whether a task is done or not.",
"type": "boolean"
},
"doneAt": {
"description": "The unix timestamp when a task was marked as done.",
"type": "integer"
},
"dueDate": {
"description": "A unix timestamp when the task is due.",
"type": "integer"
},
"endDate": {
"description": "When this task ends.",
"type": "integer"
},
"hexColor": {
"description": "The task color in hex",
"type": "string",
"maxLength": 6
},
"id": {
"description": "The unique, numeric id of this task.",
"type": "integer"
},
"labels": {
"description": "An array of labels which are associated with this task.",
"type": "array",
"items": {
"$ref": "#/definitions/models.Label"
}
},
"listID": {
"description": "The list this task belongs to.",
"type": "integer"
},
"percentDone": {
"description": "Determines how far a task is left from being done",
"type": "number"
},
"priority": {
"description": "The task priority. Can be anything you want, it is possible to sort by this later.",
"type": "integer"
},
"related_tasks": {
"description": "All related tasks, grouped by their relation kind",
"type": "object",
"$ref": "#/definitions/models.RelatedTaskMap"
},
"reminderDates": {
"description": "An array of unix timestamps when the user wants to be reminded of the task.",
"type": "array",
"items": {
"type": "integer"
}
},
"repeatAfter": {
"description": "An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \"undone\" and then increase all remindes and the due date by its amount.",
"type": "integer"
},
"startDate": {
"description": "When this task starts.",
"type": "integer"
},
"text": {
"description": "The task text. This is what you'll see in the list.",
"type": "string",
"maxLength": 250,
"minLength": 3
},
"updated": {
"description": "A unix timestamp when this task was last updated. You cannot change this value.",
"type": "integer"
}
}
}
}
},
"models.Task": {
"type": "object",
"properties": {
@ -4558,10 +4785,6 @@ var doc = `{
"description": "The list this task belongs to.",
"type": "integer"
},
"parentTaskID": {
"description": "If the task is a subtask, this is the id of its parent.",
"type": "integer"
},
"percentDone": {
"description": "Determines how far a task is left from being done",
"type": "number"
@ -4570,6 +4793,11 @@ var doc = `{
"description": "The task priority. Can be anything you want, it is possible to sort by this later.",
"type": "integer"
},
"related_tasks": {
"description": "All related tasks, grouped by their relation kind",
"type": "object",
"$ref": "#/definitions/models.RelatedTaskMap"
},
"reminderDates": {
"description": "An array of unix timestamps when the user wants to be reminded of the task.",
"type": "array",
@ -4585,13 +4813,6 @@ var doc = `{
"description": "When this task starts.",
"type": "integer"
},
"subtasks": {
"description": "An array of subtasks.",
"type": "array",
"items": {
"$ref": "#/definitions/models.Task"
}
},
"text": {
"description": "The task text. This is what you'll see in the list.",
"type": "string",
@ -4615,6 +4836,32 @@ var doc = `{
}
}
},
"models.TaskRelation": {
"type": "object",
"properties": {
"created": {
"description": "A unix timestamp when this label was created. You cannot change this value.",
"type": "integer"
},
"created_by": {
"description": "The user who created this relation",
"type": "object",
"$ref": "#/definitions/models.User"
},
"other_task_id": {
"description": "The ID of the other task, the task which is being related.",
"type": "integer"
},
"relation_kind": {
"description": "The kind of the relation.",
"type": "string"
},
"task_id": {
"description": "The ID of the \"base\" task, the task which has a relation to another.",
"type": "integer"
}
}
},
"models.Team": {
"type": "object",
"properties": {

View File

@ -399,7 +399,7 @@
"JWTKeyAuth": []
}
],
"description": "Returns a team by its ID.",
"description": "Returns a list by its ID.",
"consumes": [
"application/json"
],
@ -407,13 +407,13 @@
"application/json"
],
"tags": [
"team"
"list"
],
"summary": "Gets one team",
"summary": "Gets one list",
"parameters": [
{
"type": "integer",
"description": "Team ID",
"description": "List ID",
"name": "id",
"in": "path",
"required": true
@ -421,14 +421,14 @@
],
"responses": {
"200": {
"description": "The team",
"description": "The list",
"schema": {
"type": "object",
"$ref": "#/definitions/models.Team"
"$ref": "#/definitions/models.List"
}
},
"403": {
"description": "The user does not have access to the team",
"description": "The user does not have access to the list",
"schema": {
"type": "object",
"$ref": "#/definitions/code.vikunja.io/web.HTTPError"
@ -3191,6 +3191,134 @@
}
}
},
"/tasks/{taskID}/relations": {
"put": {
"security": [
{
"JWTKeyAuth": []
}
],
"description": "Creates a new relation between two tasks. The user needs to have update rights on the base task and at least read rights on the other task. Both tasks do not need to be on the same list.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"task"
],
"summary": "Create a new relation between two tasks",
"parameters": [
{
"description": "The relation object",
"name": "relation",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/models.TaskRelation"
}
},
{
"type": "integer",
"description": "Task ID",
"name": "taskID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "The created task relation object.",
"schema": {
"type": "object",
"$ref": "#/definitions/models.TaskRelation"
}
},
"400": {
"description": "Invalid task relation object provided.",
"schema": {
"type": "object",
"$ref": "#/definitions/code.vikunja.io/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"type": "object",
"$ref": "#/definitions/models.Message"
}
}
}
},
"delete": {
"security": [
{
"JWTKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"task"
],
"summary": "Remove a task relation",
"parameters": [
{
"description": "The relation object",
"name": "relation",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/models.TaskRelation"
}
},
{
"type": "integer",
"description": "Task ID",
"name": "taskID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "The task relation was successfully deleted.",
"schema": {
"type": "object",
"$ref": "#/definitions/models.Message"
}
},
"400": {
"description": "Invalid task relation object provided.",
"schema": {
"type": "object",
"$ref": "#/definitions/code.vikunja.io/web.HTTPError"
}
},
"404": {
"description": "The task relation was not found.",
"schema": {
"type": "object",
"$ref": "#/definitions/code.vikunja.io/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"type": "object",
"$ref": "#/definitions/models.Message"
}
}
}
}
},
"/tasks/{task}/labels": {
"get": {
"security": [
@ -4129,10 +4257,6 @@
"description": "The list this task belongs to.",
"type": "integer"
},
"parentTaskID": {
"description": "If the task is a subtask, this is the id of its parent.",
"type": "integer"
},
"percentDone": {
"description": "Determines how far a task is left from being done",
"type": "number"
@ -4141,6 +4265,11 @@
"description": "The task priority. Can be anything you want, it is possible to sort by this later.",
"type": "integer"
},
"related_tasks": {
"description": "All related tasks, grouped by their relation kind",
"type": "object",
"$ref": "#/definitions/models.RelatedTaskMap"
},
"reminderDates": {
"description": "An array of unix timestamps when the user wants to be reminded of the task.",
"type": "array",
@ -4156,13 +4285,6 @@
"description": "When this task starts.",
"type": "integer"
},
"subtasks": {
"description": "An array of subtasks.",
"type": "array",
"items": {
"$ref": "#/definitions/models.Task"
}
},
"task_ids": {
"description": "A list of task ids to update",
"type": "array",
@ -4485,6 +4607,111 @@
}
}
},
"models.RelatedTaskMap": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "object",
"properties": {
"assignees": {
"description": "An array of users who are assigned to this task",
"type": "array",
"items": {
"$ref": "#/definitions/models.User"
}
},
"created": {
"description": "A unix timestamp when this task was created. You cannot change this value.",
"type": "integer"
},
"createdBy": {
"description": "The user who initially created the task.",
"type": "object",
"$ref": "#/definitions/models.User"
},
"description": {
"description": "The task description.",
"type": "string"
},
"done": {
"description": "Whether a task is done or not.",
"type": "boolean"
},
"doneAt": {
"description": "The unix timestamp when a task was marked as done.",
"type": "integer"
},
"dueDate": {
"description": "A unix timestamp when the task is due.",
"type": "integer"
},
"endDate": {
"description": "When this task ends.",
"type": "integer"
},
"hexColor": {
"description": "The task color in hex",
"type": "string",
"maxLength": 6
},
"id": {
"description": "The unique, numeric id of this task.",
"type": "integer"
},
"labels": {
"description": "An array of labels which are associated with this task.",
"type": "array",
"items": {
"$ref": "#/definitions/models.Label"
}
},
"listID": {
"description": "The list this task belongs to.",
"type": "integer"
},
"percentDone": {
"description": "Determines how far a task is left from being done",
"type": "number"
},
"priority": {
"description": "The task priority. Can be anything you want, it is possible to sort by this later.",
"type": "integer"
},
"related_tasks": {
"description": "All related tasks, grouped by their relation kind",
"type": "object",
"$ref": "#/definitions/models.RelatedTaskMap"
},
"reminderDates": {
"description": "An array of unix timestamps when the user wants to be reminded of the task.",
"type": "array",
"items": {
"type": "integer"
}
},
"repeatAfter": {
"description": "An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \"undone\" and then increase all remindes and the due date by its amount.",
"type": "integer"
},
"startDate": {
"description": "When this task starts.",
"type": "integer"
},
"text": {
"description": "The task text. This is what you'll see in the list.",
"type": "string",
"maxLength": 250,
"minLength": 3
},
"updated": {
"description": "A unix timestamp when this task was last updated. You cannot change this value.",
"type": "integer"
}
}
}
}
},
"models.Task": {
"type": "object",
"properties": {
@ -4544,10 +4771,6 @@
"description": "The list this task belongs to.",
"type": "integer"
},
"parentTaskID": {
"description": "If the task is a subtask, this is the id of its parent.",
"type": "integer"
},
"percentDone": {
"description": "Determines how far a task is left from being done",
"type": "number"
@ -4556,6 +4779,11 @@
"description": "The task priority. Can be anything you want, it is possible to sort by this later.",
"type": "integer"
},
"related_tasks": {
"description": "All related tasks, grouped by their relation kind",
"type": "object",
"$ref": "#/definitions/models.RelatedTaskMap"
},
"reminderDates": {
"description": "An array of unix timestamps when the user wants to be reminded of the task.",
"type": "array",
@ -4571,13 +4799,6 @@
"description": "When this task starts.",
"type": "integer"
},
"subtasks": {
"description": "An array of subtasks.",
"type": "array",
"items": {
"$ref": "#/definitions/models.Task"
}
},
"text": {
"description": "The task text. This is what you'll see in the list.",
"type": "string",
@ -4601,6 +4822,32 @@
}
}
},
"models.TaskRelation": {
"type": "object",
"properties": {
"created": {
"description": "A unix timestamp when this label was created. You cannot change this value.",
"type": "integer"
},
"created_by": {
"description": "The user who created this relation",
"type": "object",
"$ref": "#/definitions/models.User"
},
"other_task_id": {
"description": "The ID of the other task, the task which is being related.",
"type": "integer"
},
"relation_kind": {
"description": "The kind of the relation.",
"type": "string"
},
"task_id": {
"description": "The ID of the \"base\" task, the task which has a relation to another.",
"type": "integer"
}
}
},
"models.Team": {
"type": "object",
"properties": {

View File

@ -74,9 +74,6 @@ definitions:
listID:
description: The list this task belongs to.
type: integer
parentTaskID:
description: If the task is a subtask, this is the id of its parent.
type: integer
percentDone:
description: Determines how far a task is left from being done
type: number
@ -84,6 +81,10 @@ definitions:
description: The task priority. Can be anything you want, it is possible to
sort by this later.
type: integer
related_tasks:
$ref: '#/definitions/models.RelatedTaskMap'
description: All related tasks, grouped by their relation kind
type: object
reminderDates:
description: An array of unix timestamps when the user wants to be reminded
of the task.
@ -98,11 +99,6 @@ definitions:
startDate:
description: When this task starts.
type: integer
subtasks:
description: An array of subtasks.
items:
$ref: '#/definitions/models.Task'
type: array
task_ids:
description: A list of task ids to update
items:
@ -360,6 +356,90 @@ definitions:
maxLength: 250
type: string
type: object
models.RelatedTaskMap:
additionalProperties:
items:
properties:
assignees:
description: An array of users who are assigned to this task
items:
$ref: '#/definitions/models.User'
type: array
created:
description: A unix timestamp when this task was created. You cannot change
this value.
type: integer
createdBy:
$ref: '#/definitions/models.User'
description: The user who initially created the task.
type: object
description:
description: The task description.
type: string
done:
description: Whether a task is done or not.
type: boolean
doneAt:
description: The unix timestamp when a task was marked as done.
type: integer
dueDate:
description: A unix timestamp when the task is due.
type: integer
endDate:
description: When this task ends.
type: integer
hexColor:
description: The task color in hex
maxLength: 6
type: string
id:
description: The unique, numeric id of this task.
type: integer
labels:
description: An array of labels which are associated with this task.
items:
$ref: '#/definitions/models.Label'
type: array
listID:
description: The list this task belongs to.
type: integer
percentDone:
description: Determines how far a task is left from being done
type: number
priority:
description: The task priority. Can be anything you want, it is possible
to sort by this later.
type: integer
related_tasks:
$ref: '#/definitions/models.RelatedTaskMap'
description: All related tasks, grouped by their relation kind
type: object
reminderDates:
description: An array of unix timestamps when the user wants to be reminded
of the task.
items:
type: integer
type: array
repeatAfter:
description: An amount in seconds this task repeats itself. If this is
set, when marking the task as done, it will mark itself as "undone"
and then increase all remindes and the due date by its amount.
type: integer
startDate:
description: When this task starts.
type: integer
text:
description: The task text. This is what you'll see in the list.
maxLength: 250
minLength: 3
type: string
updated:
description: A unix timestamp when this task was last updated. You cannot
change this value.
type: integer
type: object
type: array
type: object
models.Task:
properties:
assignees:
@ -405,9 +485,6 @@ definitions:
listID:
description: The list this task belongs to.
type: integer
parentTaskID:
description: If the task is a subtask, this is the id of its parent.
type: integer
percentDone:
description: Determines how far a task is left from being done
type: number
@ -415,6 +492,10 @@ definitions:
description: The task priority. Can be anything you want, it is possible to
sort by this later.
type: integer
related_tasks:
$ref: '#/definitions/models.RelatedTaskMap'
description: All related tasks, grouped by their relation kind
type: object
reminderDates:
description: An array of unix timestamps when the user wants to be reminded
of the task.
@ -429,11 +510,6 @@ definitions:
startDate:
description: When this task starts.
type: integer
subtasks:
description: An array of subtasks.
items:
$ref: '#/definitions/models.Task'
type: array
text:
description: The task text. This is what you'll see in the list.
maxLength: 250
@ -451,6 +527,26 @@ definitions:
user_id:
type: integer
type: object
models.TaskRelation:
properties:
created:
description: A unix timestamp when this label was created. You cannot change
this value.
type: integer
created_by:
$ref: '#/definitions/models.User'
description: The user who created this relation
type: object
other_task_id:
description: The ID of the other task, the task which is being related.
type: integer
relation_kind:
description: The kind of the relation.
type: string
task_id:
description: The ID of the "base" task, the task which has a relation to another.
type: integer
type: object
models.Team:
properties:
created:
@ -1010,9 +1106,9 @@ paths:
get:
consumes:
- application/json
description: Returns a team by its ID.
description: Returns a list by its ID.
parameters:
- description: Team ID
- description: List ID
in: path
name: id
required: true
@ -1021,12 +1117,12 @@ paths:
- application/json
responses:
"200":
description: The team
description: The list
schema:
$ref: '#/definitions/models.Team'
$ref: '#/definitions/models.List'
type: object
"403":
description: The user does not have access to the team
description: The user does not have access to the list
schema:
$ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object
@ -1037,9 +1133,9 @@ paths:
type: object
security:
- JWTKeyAuth: []
summary: Gets one team
summary: Gets one list
tags:
- team
- list
post:
consumes:
- application/json
@ -2911,6 +3007,93 @@ paths:
summary: Update all labels on a task.
tags:
- labels
/tasks/{taskID}/relations:
delete:
consumes:
- application/json
parameters:
- description: The relation object
in: body
name: relation
required: true
schema:
$ref: '#/definitions/models.TaskRelation'
type: object
- description: Task ID
in: path
name: taskID
required: true
type: integer
produces:
- application/json
responses:
"200":
description: The task relation was successfully deleted.
schema:
$ref: '#/definitions/models.Message'
type: object
"400":
description: Invalid task relation object provided.
schema:
$ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object
"404":
description: The task relation was not found.
schema:
$ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
type: object
security:
- JWTKeyAuth: []
summary: Remove a task relation
tags:
- task
put:
consumes:
- application/json
description: Creates a new relation between two tasks. The user needs to have
update rights on the base task and at least read rights on the other task.
Both tasks do not need to be on the same list.
parameters:
- description: The relation object
in: body
name: relation
required: true
schema:
$ref: '#/definitions/models.TaskRelation'
type: object
- description: Task ID
in: path
name: taskID
required: true
type: integer
produces:
- application/json
responses:
"200":
description: The created task relation object.
schema:
$ref: '#/definitions/models.TaskRelation'
type: object
"400":
description: Invalid task relation object provided.
schema:
$ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
type: object
security:
- JWTKeyAuth: []
summary: Create a new relation between two tasks
tags:
- task
/tasks/all:
get:
consumes: