Skip to content

Conversation

VinuB-Dev
Copy link
Contributor

@VinuB-Dev VinuB-Dev commented Nov 15, 2024

Date: 15/11/2024
Developer Name: Vignesh B S


Issue Ticket Number

Closes Real-Dev-Squad/website-dashboard#888

Description

Implemented changes in tasks api for Tracking Orphaned Tasks

  • tasks?orphaned=true - Retrieves tasks assigned to users who have departed the Discord server.

Added test cases for the above api.

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1

Screenshot 2024-11-15 at 3 53 50 PM

Test Coverage

Screenshot 1

Screenshot 2024-11-15 at 3 54 09 PM

Additional Notes

PRD
Design Doc
Have moved the updateTaskStatusToDone function to models as it was directly interacts with the database and performing operations such as updating task documents. This was also causing circular dependency issues.

- tasks/orphaned-tasks retrieves tasks assigned to departed users

Added test cases for the API and fixed test case issues arising from mock data additions used in current API testing.
… and the corresponding queries to model.

- removed test cases from integration testing and moved it to unit testing.
- moved updateTaskStatusToDone to tasks model as it was causing circular dependency.
- created a separate fixture file for mock data required to test the feature.
- reverted the test case changes done for other test cases due to mock data changes.
@VinuB-Dev VinuB-Dev force-pushed the feat/orphaned-tasks-api branch from cfb3fb0 to b4415d9 Compare November 15, 2024 17:39
VinuB-Dev and others added 4 commits November 16, 2024 10:12
- Added function documentation for all the modified and new model functions.
- Implemented a negative unit test case for the `fetchUsersNotInDiscordServer` function.
- Updated `fetchUsersNotInDiscordServer` to use `userId` as a parameter instead of the entire `user` object.
- Added test cases for recent model changes.
…the /tasks/orphaned-tasks API.

- Implemented negative test cases for the /tasks/orphaned-tasks endpoint:
  - Tested the scenario where the dev flag is not provided, expecting a 404 status code with a "Route not found" message.
  - Tested the scenario where the database query fails, ensuring the API responds with a 500 status code and an appropriate error message.
Comment on lines +139 to +150
status,
page,
size,
prev,
next,
q: queryString,
assignee,
title,
userFeatureFlag,
orphaned,
dev,
} = req.query;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we using all these query?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I only added orphaned and dev, it's prettier change.

Copy link
Contributor

@pankajjs pankajjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left comment

@VinuB-Dev
Copy link
Contributor Author

Splitting this PR into smaller parts for easier review. This PR will serve as the main split: #2267. Closing this PR as part of the process.

@VinuB-Dev VinuB-Dev closed this Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement APIs for Tracking Orphaned Tasks and Departed Users.
3 participants