Skip to content

Conversation

VinuB-Dev
Copy link
Contributor

@VinuB-Dev VinuB-Dev commented Nov 25, 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.

Test Cases

Test cases for the above API are included in a separate PR due to dependency stacking:

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-26 at 12 11 08 PM

Test Coverage

Screenshot 1

Screenshot 2024-11-26 at 12 20 32 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.

API contracts

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.

@VinuB-Dev Tests are failing.

@VinuB-Dev
Copy link
Contributor Author

@VinuB-Dev Tests are failing.

Tests PR is yet to be merged into this, that's why it's failing.

@byt3quester
Copy link
Contributor

Can you add the test coverage of the files you changed?

@VinuB-Dev
Copy link
Contributor Author

Can you add the test coverage of the files you changed?

The test cases are included in a separate PR, which will be merged here once the changes are approved.
PR link: VinuB-Dev#1
A screenshot of the test coverage after executing the tests has been added to the description.

Feat: Added tests for orphaned tasks.
… tasks

- Replaced individual queries with `fetchIncompleteTasksByUserIds` to fetch tasks in batch for users not in the Discord server.
- Improved performance by reducing the number of database queries.
- Modified testcases based on the updates.
@VinuB-Dev VinuB-Dev requested a review from pankajjs November 28, 2024 09:46
@pankajjs
Copy link
Contributor

LGTM

@iamitprakash iamitprakash merged commit 41e6a5c into Real-Dev-Squad:develop Nov 30, 2024
3 checks passed
byt3quester pushed a commit to byt3quester/website-backend that referenced this pull request Dec 2, 2024
* feat: orphaned tasks API changes.

* feat: Added tests for orphaned tasks.

* chore: Returned without a block for usersnaptop empty and added spacing to make it more readable.

* Refactor: Update fetchOrphanedTasks to use batch query for incomplete tasks

- Replaced individual queries with `fetchIncompleteTasksByUserIds` to fetch tasks in batch for users not in the Discord server.
- Improved performance by reducing the number of database queries.
- Modified testcases based on the updates.

* fix: Changed abandoned tasks to orphaned tasks.

* Fix: Changed the validation type of orphaned to boolean instead of string.
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.
4 participants