Skip to content

Commit

Permalink
refactor: fix tests and general clean up
Browse files Browse the repository at this point in the history
fix failing tests on CI & general clean up so all files follow a similar format
  • Loading branch information
MattCMcCoy committed Feb 21, 2024
1 parent 4ec0e1a commit eaca6e6
Show file tree
Hide file tree
Showing 6 changed files with 415 additions and 232 deletions.
144 changes: 107 additions & 37 deletions backend/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Task"
"$ref": "#/definitions/tasks.TaskBody"
}
}
],
Expand Down Expand Up @@ -561,6 +561,69 @@ 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": [
Expand Down Expand Up @@ -627,7 +690,7 @@ const docTemplate = `{
}
}
},
"/tasks/{tid}/assigned-users": {
"/tasks/{tid}/assigned": {
"get": {
"description": "Get list of users assigned to a task by task ID",
"tags": [
Expand Down Expand Up @@ -662,41 +725,6 @@ const docTemplate = `{
}
}
},
"/tasks/{tid}/info": {
"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/models.Task"
}
}
],
"responses": {
"200": {
"description": "Updated Task",
"schema": {
"$ref": "#/definitions/models.Task"
}
}
}
}
},
"/tasks/{tid}/labels": {
"get": {
"description": "get a tasks labels given the task id",
Expand Down Expand Up @@ -1075,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
144 changes: 107 additions & 37 deletions backend/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Task"
"$ref": "#/definitions/tasks.TaskBody"
}
}
],
Expand Down Expand Up @@ -554,6 +554,69 @@
}
},
"/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": [
Expand Down Expand Up @@ -620,7 +683,7 @@
}
}
},
"/tasks/{tid}/assigned-users": {
"/tasks/{tid}/assigned": {
"get": {
"description": "Get list of users assigned to a task by task ID",
"tags": [
Expand Down Expand Up @@ -655,41 +718,6 @@
}
}
},
"/tasks/{tid}/info": {
"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/models.Task"
}
}
],
"responses": {
"200": {
"description": "Updated Task",
"schema": {
"$ref": "#/definitions/models.Task"
}
}
}
}
},
"/tasks/{tid}/labels": {
"get": {
"description": "get a tasks labels given the task id",
Expand Down Expand Up @@ -1068,6 +1096,48 @@
}
}
}
},
"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"
}
}
}
}
}
Loading

0 comments on commit eaca6e6

Please sign in to comment.