diff --git a/tasks/README.md b/tasks/README.md index 3a08a8c1..3c8983d0 100644 --- a/tasks/README.md +++ b/tasks/README.md @@ -26,7 +26,7 @@ , ], - "level": 1 | 2 | 3 | 4 | 5 // optional - can be added only if category exists, + "level": 1 | 2 | 3 | 4 | 5 // optional - can be added only if category exists, "category": // optional (example: "FRONTEND" | "BACKEND"), "participants": [ // for group tasks @@ -57,15 +57,15 @@ ## **Requests** -| Route | Description | -| :--------------------------------: | :---------------: | -| [GET /tasks](#get-tasks) | Returns all tasks | -| [GET /tasks/self](#get-tasksself) | Returns all tasks of a user | -| [POST /tasks](#post-tasks) | Creates new task | -| [PATCH /tasks/:id](#patch-tasksid) | Updates tasks | -| [GET /tasks/:id/details](#get-tasksiddetails) | Get details of a particular task| -| [GET /tasks/:username](#get-tasksusername) | Returns all tasks of the user | -| [PATCH /tasks/self/:id](#patch-tasksselfid) | Changes in own task | +| Route | Description | +| :-------------------------------------------: | :------------------------------: | +| [GET /tasks](#get-tasks) | Returns all tasks | +| [GET /tasks/self](#get-tasksself) | Returns all tasks of a user | +| [POST /tasks](#post-tasks) | Creates new task | +| [PATCH /tasks/:id](#patch-tasksid) | Updates tasks | +| [GET /tasks/:id/details](#get-tasksiddetails) | Get details of a particular task | +| [GET /tasks/:username](#get-tasksusername) | Returns all tasks of the user | +| [PATCH /tasks/self/:id](#patch-tasksselfid) | Changes in own task | ## **GET /tasks** @@ -73,7 +73,7 @@ Returns all the tasks - **Params** None -- **Query** +- **Query** - Optional: `dev=[boolean]` (`dev` is passed to get all tasks in the developer mode with features that are flagged) - Optional: `status=[string]` (`status` is a case insenstive string with one of the following values [AVAILABLE, ASSIGNED, COMPLETED, IN_PROGRESS, BLOCKED, SMOKE_TESTING, NEEDS_REVIEW, IN_REVIEW, APPROVED, MERGED, SANITY_CHECK, REGRESSION_CHECK, RELEASED, VERIFIED, DONE, UNASSIGNED] which represents the status of the task) - Optional: `assignee=[string]` (`assignee` can be assignee username in case of single assignee or multiple comma separated values in case of multiple assignee) @@ -82,6 +82,7 @@ Returns all the tasks - Optional: `size=[integer]` (`size` is the number of tasks requested per page. Range of value is 1-100. Default value is 5) - Optional: `next=[string]` (`next` is id of the document to get next page of results from that document) - Optional: `prev=[string]` (`prev` is id of the document to get prev page of results from that document) + - Optional: `orphaned=[boolean]` ( if orphaned is set to true with dev feature flag as true, it will return all the pending tasks which have assigned to users who have departed the discord server. ) - **Body** None - **Headers** @@ -102,10 +103,16 @@ Returns all the tasks } ``` +- **Code:** 204 (for `orphaned=true` when no orphaned tasks exist) + + - **Content:** `No Content` + - **Error Response:** - **Code:** 500 - **Content:** `{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }` - + - **Code:** 404 (for `orphaned=true` without `dev=true`) + - **Content:** + `{ 'message': 'Route not found' }` ## **GET /tasks/self** @@ -124,6 +131,7 @@ Returns all the completed tasks of user if query `completed=true` is passed, els - **Success Response:** - **Code:** 200 - **Content:** + ``` [ {}, @@ -157,6 +165,7 @@ Returns details of a particular task - **Success Response:** - **Code:** 200 - **Content:** + ``` { "message":"task returned successfully", @@ -187,6 +196,7 @@ Returns all tasks of the requested user. - **Success Response:** - **Code:** 200 - **Content:** + ``` { message: 'Tasks returned successfully!' @@ -203,7 +213,6 @@ Returns all tasks of the requested user. - **Code:** 500 - **Content:** `{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }` - ## **POST /tasks** - **Params** @@ -265,10 +274,11 @@ Returns all tasks of the requested user. - **Headers** Content-Type: application/json -- **Body** +- **Body** + ``` - { - status: + { + status: percentCompleted: } ``` @@ -278,6 +288,7 @@ Returns all tasks of the requested user. - **Success Response:** - **Code**: 200 + ``` { message: 'Task updated successfully!' @@ -292,6 +303,7 @@ Returns all tasks of the requested user. } } ``` + - **Error Response:** - **Code:** 401 - **Content:** `{ 'statusCode': 401, 'error': 'Unauthorized', 'message': 'User can not be authenticated' }` diff --git a/users/README.md b/users/README.md index 1165e575..538991e3 100644 --- a/users/README.md +++ b/users/README.md @@ -37,18 +37,18 @@ number and email address. ## **Requests** -| Route | Description | -| :----------------------------------------------------: | :----------------------------------: | -| [GET /users](#get-users) | Returns all users in the system | -| [GET /users/self](#get-usersSelf) | Returns the logged in user's details | -| [GET /users/userId/:userId](#get-usersuseriduserid) | Returns user with given userId | -| [GET /users/:username](#get-usersusername) | Returns user with given username | -| [GET /users/:userId/badges](#get-usersidbadges) | Returns badges assigned to the user | -| [GET /users/search](#get-users-search) | Returns users based on specified filters | -| [POST /users](#post-users) | Creates a new User | -| [PATCH /users/self](#patch-usersself) | Updates data of the User | -| [PATCH /users/:id/temporary/data](#patch-usersidroles) | Updates user roles | -| [PATCH /users](#patch-users) | Archive users if not in discord | +| Route | Description | +| :----------------------------------------------------: | :--------------------------------------: | +| [GET /users](#get-users) | Returns all users in the system | +| [GET /users/self](#get-usersSelf) | Returns the logged in user's details | +| [GET /users/userId/:userId](#get-usersuseriduserid) | Returns user with given userId | +| [GET /users/:username](#get-usersusername) | Returns user with given username | +| [GET /users/:userId/badges](#get-usersidbadges) | Returns badges assigned to the user | +| [GET /users/search](#get-users-search) | Returns users based on specified filters | +| [POST /users](#post-users) | Creates a new User | +| [PATCH /users/self](#patch-usersself) | Updates data of the User | +| [PATCH /users/:id/temporary/data](#patch-usersidroles) | Updates user roles | +| [PATCH /users](#patch-users) | Archive users if not in discord | ## **GET /users** @@ -64,6 +64,7 @@ Returns all users in the system. - Optional: `next=[string]` (`next` is the id of the DB document to get the next batch/page of results after that document.) - Optional: `prev=[string]` (`prev` is the id of the DB document to get the previous batch/page of results before that document.) - Optional: `query=[string]` (`query` can be used to filter and/or sort users based on their PR and Issue status within a given date range. [Learn more](https://github.com/Real-Dev-Squad/website-backend/wiki/Filter-and-sort-users-based-on-PRs-and-Issues) ) + - Optional: `departed=[boolean]` ( if departed is set to true with dev feature flag as true, it will return all the users who have departed the discord server with pending tasks assigned to them. ) - **Body** None - **Headers** @@ -71,7 +72,9 @@ Returns all users in the system. - **Cookie** rds-session: `` - **Success Response:** + - **Code:** 200 + - **Content:** ``` @@ -88,7 +91,9 @@ Returns all users in the system. ``` **If `/users?profile=true`** + - **Code:** 200 + - **Content:** ``` @@ -97,10 +102,20 @@ Returns all users in the system. } ``` + **If `/users?departed=true&dev=true`** + + - **Code:** 204 (for `departed=true` when no abandoned tasks exist) + + - **Content:** + `{}` + - **Error Response:** - **Code:** 401 - **Content:** `{ 'statusCode': 401, 'error': 'Unauthorized', 'message': 'Unauthenticated User' }` + - **Code:** 404 (for `departed=true` without `dev=true`) + - **Content:** + `{ 'message': 'Route not found' } ## **GET /users/self** @@ -235,6 +250,7 @@ Returns users based on the specified filters. None - **Query Parameters:** + - Optional: `levelId=[string]` (Specifies the level ID) - Optional: `levelName=[string]` (Specifies the level name) - Optional: `levelValue=[number]` (Specifies the level value) @@ -252,7 +268,9 @@ Returns users based on the specified filters. rds-session: `` - **Success Response:** + - **Code:** 200 + - **Content:** ``` @@ -270,11 +288,14 @@ Returns users based on the specified filters. ``` - **Error Response:** + - **Code:** 400 + - **Content:** `{ 'statusCode': 400, 'error': 'Bad Request', 'message': 'Filter for item not provided' }` - **Code:** 401 + - **Content:** `{ 'statusCode': 401, 'error': 'Unauthorized', 'message': 'Unauthenticated User' }` @@ -307,12 +328,13 @@ Creates a new User. `{ 'statusCode': 401, 'error': 'Unauthorized', 'message': 'Unauthenticated User' }` ## **PATCH /users/self(To Be Deprecated)** - > **⚠️ Deprecation Notice** - > - > This endpoint is scheduled for deprecation. A new endpoint will be announced in the future to replace this functionality. - Please prepare to update your integrations accordingly. -Updates data of the User. Doesn't update if user is `(in_discord && !userDetailsIncomplete)`, Except for `disabled_roles` property. +> **⚠️ Deprecation Notice** +> +> This endpoint is scheduled for deprecation. A new endpoint will be announced in the future to replace this functionality. +> Please prepare to update your integrations accordingly. + +Updates data of the User. Doesn't update if user is `(in_discord && !userDetailsIncomplete)`, Except for `disabled_roles` property. - **Params** None @@ -396,7 +418,7 @@ Archive users if not in Discord. ```json { - "action": "nonVerifiedDiscordUsers | archiveUsers" + "action": "nonVerifiedDiscordUsers | archiveUsers" } ``` @@ -406,12 +428,12 @@ Archive users if not in Discord. ```json { - "message": "Successfully updated users archived role to true if in_discord role is false | Couldn't find any users currently inactive in Discord but not archived.", - "data": { - "totalUsers": "number", - "totalUsersArchived": "number", - "totalOperationsFailed": "number" - } + "message": "Successfully updated users archived role to true if in_discord role is false | Couldn't find any users currently inactive in Discord but not archived.", + "data": { + "totalUsers": "number", + "totalUsersArchived": "number", + "totalOperationsFailed": "number" + } } ``` @@ -419,14 +441,14 @@ Archive users if not in Discord. ```json { - "message": "Successfully updated users archived role to true if in_discord role is false | Couldn't find any users currently inactive in Discord but not archived.", - "data": { - "totalUsers": "number", - "totalUsersArchived": "number", - "totalOperationsFailed": "number", - "updatedUserDetails": "array", - "failedUserDetails": "array" - } + "message": "Successfully updated users archived role to true if in_discord role is false | Couldn't find any users currently inactive in Discord but not archived.", + "data": { + "totalUsers": "number", + "totalUsersArchived": "number", + "totalOperationsFailed": "number", + "updatedUserDetails": "array", + "failedUserDetails": "array" + } } ``` @@ -438,9 +460,9 @@ Archive users if not in Discord. ```json { - "statusCode": 401, - "error": "Unauthorized", - "message": "Unauthenticated User" + "statusCode": 401, + "error": "Unauthorized", + "message": "Unauthenticated User" } ``` @@ -450,9 +472,9 @@ Archive users if not in Discord. ```json { - "statusCode": 400, - "error": "Bad Request", - "message": "Invalid payload" + "statusCode": 400, + "error": "Bad Request", + "message": "Invalid payload" } ``` @@ -462,8 +484,8 @@ Archive users if not in Discord. ```json { - "statusCode": 500, - "error": "Internal Server Error", - "message": "An internal server error occurred" + "statusCode": 500, + "error": "Internal Server Error", + "message": "An internal server error occurred" } ```