generated from Real-Dev-Squad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds tasks/users/discord route #173
Open
Ajeyakrishna-k
wants to merge
5
commits into
main
Choose a base branch
from
Ajeyakrishna-k-patch-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f0afa5c
feat: adds tasks/users/discord route
Ajeyakrishna-k 0336d29
chore: improve description
Ajeyakrishna-k 205bdcd
chore: updates response object
Ajeyakrishna-k 931afa2
Update README.md
Ajeyakrishna-k 895d3bd
Update README.md
Ajeyakrishna-k File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,7 @@ | |
| [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/users/discord](#get-tasksusersdiscord) | Returns discord details of users with active tasks | | ||
|
||
## **GET /tasks** | ||
|
||
|
@@ -301,3 +302,41 @@ Returns all tasks of the requested user. | |
- **Content:** `{ 'statusCode': 404, 'error': 'Not Found', 'message': 'Task doesn't exist' }` | ||
- **Code:** 500 | ||
- **Content:** `{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }` | ||
|
||
## **GET /tasks/users/discord** | ||
|
||
Returns the list of users discord id who have not provided an update on their task | ||
- **Params** | ||
None | ||
- **Query** | ||
- Optional: `q=[string]` (`q` can have the following values) | ||
- Optional: `status=[string]` (`status` is a case senstive string with one of the following values [missed-updates] ) | ||
- Optional: `date-count=[integer]` (`date-count` is the number of days where the users have not provided an update ont their task default :[3] ) | ||
- Optional: `date=[timestamp]` (`date` is the timestamp of the date that needs to be excluded from the date-count. No default. eg [1702122435405] ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. date-count from where |
||
- Optional: `weekday=[string]` (`weekday` the weekday that needs to be excluded while calculating the missed updates eg: [sun,mon,tue,wed,thu,fri,sat]) | ||
- Optional: `size=[integer]` (`size` is the number of tasks that are processed to find the users. Range of value is 1-1000.) | ||
- Optional: `cursor=[string]` (`cursor` is id of the document to get next page of results from that document) | ||
eg: `?size=10&cursor=1xh3Bsd32&q=status:missed-updates -date-count:3 -date:1702122435405 -weekday:sun -weekday:sat` | ||
- **Body** | ||
None | ||
- **Headers** | ||
Content-Type: application/json | ||
- **Success Response:** | ||
- **Code:** 200 | ||
- **Content:** | ||
``` | ||
{ | ||
message: 'Discord details of users with status missed updates fetched successfully', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you re-phrase this line |
||
data: { | ||
usersToAddRole: Array : `List of users who missed update` | ||
tasks: number : `Total tasks processed` | ||
missedUpdatesTasks: number : `Tasks with missed updates` | ||
} | ||
} | ||
``` | ||
|
||
- **Error Response:** | ||
- **Code:** 400 | ||
- **Content:** `{ 'statusCode': 400, 'error': 'Bad request' }` | ||
- **Code:** 500 | ||
- **Content:** `{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check grammar here