Skip to content

Commit

Permalink
remaining task routes (get task, update task, create task) (#33)
Browse files Browse the repository at this point in the history
* haleys remaining task routes
  • Loading branch information
MattCMcCoy authored Feb 23, 2024
1 parent 9066bb0 commit a02de69
Show file tree
Hide file tree
Showing 6 changed files with 1,058 additions and 23 deletions.
191 changes: 191 additions & 0 deletions backend/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,34 @@ const docTemplate = `{
}
}
},
"/tasks": {
"post": {
"description": "Create a new task",
"tags": [
"tasks"
],
"summary": "Create a New Task",
"parameters": [
{
"description": "Create Task Request",
"name": "request_body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/tasks.TaskBody"
}
}
],
"responses": {
"201": {
"description": "Created Task",
"schema": {
"$ref": "#/definitions/models.Task"
}
}
}
}
},
"/tasks/assigned": {
"get": {
"description": "get tasks assigned to given users",
Expand Down Expand Up @@ -532,6 +560,92 @@ const docTemplate = `{
}
}
},
"/tasks/{tid}": {
"get": {
"description": "get a task given its id",
"tags": [
"tasks"
],
"summary": "get task by id",
"parameters": [
{
"type": "integer",
"description": "the id of the task",
"name": "tid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Task"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
},
"put": {
"description": "Update the task_info field of a task by ID",
"tags": [
"tasks"
],
"summary": "Update Task Info",
"parameters": [
{
"type": "integer",
"description": "Task ID",
"name": "tid",
"in": "path",
"required": true
},
{
"description": "Update Task Info Request",
"name": "request_body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/tasks.TaskBody"
}
}
],
"responses": {
"200": {
"description": "Updated Task",
"schema": {
"$ref": "#/definitions/models.Task"
}
}
}
},
"delete": {
"description": "Delete a task by ID",
"tags": [
"tasks"
],
"summary": "Delete a Task",
"parameters": [
{
"type": "integer",
"description": "Task ID",
"name": "tid",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
}
}
}
},
"/tasks/{tid}/assign": {
"post": {
"description": "assign users to task",
Expand Down Expand Up @@ -576,6 +690,41 @@ const docTemplate = `{
}
}
},
"/tasks/{tid}/assigned": {
"get": {
"description": "Get list of users assigned to a task by task ID",
"tags": [
"tasks"
],
"summary": "Get list of users assigned to a task",
"parameters": [
{
"type": "integer",
"description": "Task ID",
"name": "tid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "List of user IDs assigned to the task",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
}
},
"/tasks/{tid}/labels": {
"get": {
"description": "get a tasks labels given the task id",
Expand Down Expand Up @@ -954,6 +1103,48 @@ const docTemplate = `{
}
}
}
},
"tasks.TaskBody": {
"type": "object",
"properties": {
"created_by": {
"description": "User ID",
"type": "string"
},
"created_date": {
"type": "string"
},
"end_date": {
"type": "string"
},
"group_id": {
"type": "integer"
},
"notes": {
"type": "string"
},
"repeating": {
"type": "boolean"
},
"repeating_end_date": {
"type": "string"
},
"repeating_interval": {
"type": "string"
},
"start_date": {
"type": "string"
},
"task_info": {
"type": "string"
},
"task_status": {
"type": "string"
},
"task_type": {
"type": "string"
}
}
}
}
}`
Expand Down
Loading

0 comments on commit a02de69

Please sign in to comment.