Skip to content
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

Feat: Implement APIs for Tracking Departed Users with Assigned Tasks #2268

Merged

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 users API for Tracking Departed Users.

  • users?departed=true - Retrieves users who had a task assigned and 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

Test Coverage

Screenshot 1

Screenshot 2024-11-26 at 12 09 32 PM

Additional Notes

PRD
Design Doc
Have moved the archieveUsers 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

@VinuB-Dev VinuB-Dev force-pushed the feat/departed-users-api-changes branch from 3ba4c10 to 36e067d Compare November 25, 2024 19:22
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.

Can you update the screenshots?

@VinuB-Dev
Copy link
Contributor Author

Can you update the screenshots?

Updated

feat: Added test cases for departed users api changes.
middlewares/validators/user.js Show resolved Hide resolved
services/users.js Outdated Show resolved Hide resolved
test/integration/users.test.js Show resolved Hide resolved
controllers/users.js Show resolved Hide resolved
…nd filter in-memory

- Replaced Firestore query with batch query to fetch incomplete tasks for multiple users at once.
- Filter tasks by user IDs and completed statuses in-memory for improved efficiency.
- Updated return structure to return an array directly instead of an object with `docs` property.
- Updated test cases related to the same.
iamitprakash
iamitprakash previously approved these changes Nov 30, 2024
@iamitprakash iamitprakash merged commit 10bc222 into Real-Dev-Squad:develop Nov 30, 2024
3 checks passed
listiclehub1 pushed a commit to listiclehub1/website-backend that referenced this pull request Dec 2, 2024
…eal-Dev-Squad#2268)

* feat: Departed users api changes.

* feat: Added test cases for departed users api changes.

* Refactor: Update fetchIncompleteTasksByUserIds to use batch queries and filter in-memory

- Replaced Firestore query with batch query to fetch incomplete tasks for multiple users at once.
- Filter tasks by user IDs and completed statuses in-memory for improved efficiency.
- Updated return structure to return an array directly instead of an object with `docs` property.
- Updated test cases related to the same.
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.
5 participants